ShawnExcel
Member
Hello! I have created a 'reporting' system where 100 people all use an excel form saved to their computer, and when they hit "submit" it opens another .xlsb file in a shared drive, finds the next line, and puts the data on the next line. This all takes 2-5 seconds to complete, however, if two people hit "submit" at the same time then one gets an error that the file is already open.
I am trying to write VBA that does the following:
1) Check if Database.xlsb is open by another user
2) If not, continue with the code
3) If yes (file is not available), then wait 5 seconds and try again, wait 5 more seconds and try again, wait 5 more seconds and try again, display msgbox "Could not submit data, please try again in a few minutes (then exit sub)
I have found numerous example of code with the "FileIsFree" or "FileIsOpen" variables, however my Excel 2010 says that is not working. Thank you in advance for the help!
I am trying to write VBA that does the following:
1) Check if Database.xlsb is open by another user
2) If not, continue with the code
3) If yes (file is not available), then wait 5 seconds and try again, wait 5 more seconds and try again, wait 5 more seconds and try again, display msgbox "Could not submit data, please try again in a few minutes (then exit sub)
I have found numerous example of code with the "FileIsFree" or "FileIsOpen" variables, however my Excel 2010 says that is not working. Thank you in advance for the help!