Re: Before Opening a File, Trap if access is not available
Anthony,
You are quite correct. The file is one of many held in Sharepoint. I fully agree, the code you published should be exactly what I want to do. I had started down the path of trying to make something work by plugging the holes. Part of my problem is that I have only seen the problem from a few perspectives.
I am a Sharepoint administrator and have no problem from a our work network. I sent the file home and found
From my home computer, I do not have access and get the wanted error message
From my work Computer (offline at home), I do not have access and get the wanted error message
From my work Computer (connected to Internet), I do not have access and get the wanted error message
Then I establish a VPN connection to work and expect to get in but find, I do not have access and get the now un-expected error message
Next I opened the Sharepoint Site and looked at the file in Internet Explorer
I then tried again expecting for sure I would have access but found, I do not have access and get the now even more un-expected error message
When I returned to work this morning, and tried from our network with exactly the same file as last night and that worked yesterday afternoon, I do not have access and get the Most un-expected error message
With no reasonable explanation, it started working both for myself and for another user an hour or so later
When I sent it to a third person, (after the usual lowering of macro security etc) I found he did not have access and this is good because I had not enabled him. When I did, and waited half an hour for any latent permissions to filter through, he still did not have access. After I drilled down to the site and looked at the file on his computer, I then tried again and it worked.
It is almost as though Excel is working with a cached set of permissions which is in consistent with the command which is specifically supposed to check the current state of the file, ie, does anyone else currently have it open?
I realise this all makes it a cross application problem but the fundamental problem remains, irrespective of whether it is a Sharepoint site or a public folder, I would like to try and open the file and if it Bombs out, take control of the error handling before I let the Native Excel error handler broadcast the problem.
Regards,
Michael