Hi guys
I feel like this should be simple but I don't seem to be able to work out the answer.
Currently I have a sheet containing data that is used by around 50 users. They each have their own allocator sheet, which (when a macro runs) then opens up the master sheet, takes some data, then saves and closes the master sheet again. This way there are no sharing violations, etc, and each item is only allocated to one person.
In order for this to work, the allocator sheet checks to see if the master sheet is in use before opening it, using the following:
and then in the main code:
This works fine 99% of the time, but there have been a small number of incidents where people have both downloaded the same items. I believe this is because the file takes a small amount of time to open, and isn't opened until after the check is done. So if 2 people run the macro almost simultaneously, the second person's sees that the file isn't in use, and starts to open it - but the first person's has already opened the file by this stage.
So what I'd like to do is check (once the file has been opened for use) to see if the file is only opened as 'read-only' state, and if so to repeat the process again.
Any ideas guys?
Bookmarks