If you see an error message like the one below, which was produced by Microsoft Excel for Mac 2016 on a Mac OS X system, even though you don't have the file open currently, then you will need to delete the lock file, which should be in the same directory as the spreadsheet.
This file is locked for editing.
Locked by: John Doe
Filename: SGRS_2017.xlsm
You can open the file as read-only.
The lock file will have the same name as the workbook you were trying
to open, but the file name will have ~$
prepended to it. To
delete the file you will need to "escape" the meaning of the dollar sign
by putting an escape character, i.e., a backslash character, immediately
before the dollar sign. I.e., use ~\$
as shown below:
$ ls -alg **SGRS_2017.xlsm -rw-rw-r--@ 1 ABC\Domain Users 761327 Sep 13 15:57 SGRS_2017.xlsm -rw-rw-r--@ 1 ABC\Domain Users 171 Sep 18 22:46 ~$SGRS_2017.xlsm $ rm ~$SGRS_2017.xlsm rm: ~.xlsm: No such file or directory $ rm ~\$SGRS_2017.xlsm $
Once the lock file has been deleted, you should be able to open the file without the warning message that it is locked for editing.