I have a spreadsheet that's used by many people (who all want to make changes at roughly the same time each day) - too many for sharing to work without a ridiculous number of conflicts constantly cropping up. So it's not shared and we have to trust users to go in, make changes, save and close quickly.
But, of course, sometimes someone keeps it open blocking others from using it and usually Excel just says it's locked for editing by "another user".
I wrote a little VBA designed to remind the user every 5 minutes to close the file if they've finished with it. It works, but (inexplicably) it keeps working even after the spreadsheet is closed - it just opens it again and displays the reminder (defeating the object).
So, my question is: how can I force the VBA loop to quit when I close the spreadsheet?
My code is:
Thanks
But, of course, sometimes someone keeps it open blocking others from using it and usually Excel just says it's locked for editing by "another user".
I wrote a little VBA designed to remind the user every 5 minutes to close the file if they've finished with it. It works, but (inexplicably) it keeps working even after the spreadsheet is closed - it just opens it again and displays the reminder (defeating the object).
So, my question is: how can I force the VBA loop to quit when I close the spreadsheet?
My code is:
Code:
Sub Macro2()
alertTime = Now + TimeValue("00:05:00")
Application.OnTime alertTime, "my_Procedure"
End Sub
Sub my_Procedure()
MsgBox "Please close the spreadsheet if you have finished your work"
Call Macro2
End Sub
Thanks