Hi, I am trying to establish error handling for when a SharePoint-based network file won't save properly due to it being locked for editing by another user. When this happens, I simply want network users to get a message box indicating that the data wasn't saved. They can then request the individual using the file to close it or just not worry about the data updating. The problem I'm running into is VBA is not seeing the upload failure as an error, therefore not triggering the error sequence. If I run the Workbook.Save outside of error handling, the to-be-saved file has a yellow bar stating, "UPLOAD FAILED: This file is locked for editing by another user." This seems like an 'error' to me. Oddly enough, these circumstances create debug errors in other workbooks when the file is locked, but in this instance there is no debug.
This seems like a trivial issue, but I couldn't find ANYTHING online addressing this.
Thank you all for any help in advance!
This is a simplified version of the code:
Sub saveFile()
On Error GoTo Fail
Workbook.Save
Exit Sub
Fail:
MsgBox "Cannot update data. File is locked for editing by another user."
End Sub
This seems like a trivial issue, but I couldn't find ANYTHING online addressing this.
Thank you all for any help in advance!
This is a simplified version of the code:
Sub saveFile()
On Error GoTo Fail
Workbook.Save
Exit Sub
Fail:
MsgBox "Cannot update data. File is locked for editing by another user."
End Sub