How do I determine if a file is locked for editing?
I have the following code in the ThisWorkbook module of a workbook maintained by our accounting dept. The P:\ Drive is a public folder on our server.
It works almost 100% of the time. However, if someone happens to have the copy open (I think that is when it happens) and accounting saves their version, the result is the copy in the public folder become corrupted.
If I manually open a file in the public folder and someone else has it open, I get a dialog telling me the file is already in use by "AnotherUser" and is locked for editing. See picture attached.
What would be the property to tell me this, so I can bypass the "SaveCopyAs" routine if the file is locked for editing?
Bookmarks