1

In a 2010 Excel file I have a macro that downloads an Access database file from an external 2007 SharePoint site by mapping the SharePoint folder to an open drive. I've distributed the file to other users in the company and it works in two locations but in the third location I'm getting an error indicating that user has not been authorized even though I've opened a IE browser and navigated inside of the SP site. I've also tried uploading a file to reauthenticate a user, which works in the first two locations but not the third.

Any idea of what could be causing this, and if so, how can I work around it?

UPDATE 1

The users are not being authenticated when they Excel tries to download the file. Which is odd because if I open Internet Explorer and navigate to the SharePoint site they automatically logs them in. I've started venturing into C# in hopes of writing a simple DLL to pass the user's credentials, but I'm having trouble getting the authentication cookie to use to actually download the file.

UPDATE 2

Since the user can open their IE browser which authenticates them, I ended up writing a script that opens an instance of IE, navigates to the SP site, downloads the file, then using the Windows API loops through all of the windows to find the download one and use send keys to tell it to save. Once the save is done I clear the download list and quit IE. It's not the best solution since the user will see this all taking place (working on fixing now) and any user interaction at the point will screw it up, but it works for now.

  • Can you try the failing user credentials in the first location and make sure its not a permission issue. – Amal Hashim Jul 7 '16 at 18:56
  • I've tried using my credentials across all three locations with the same results. I can login in through IE, but when I try to map the drive it says I'm not authenticated. – pheeper Jul 7 '16 at 19:56
  • Have you tried to look at Event Viewer after running the script on this machine? Specifically, you should look for errors and warnings in Windows Logs->Application and also Windows Logs->Security. You can run Event Viewer by right clicking on your computer's icon, and choosing "Manage". – Greg Thatcher Jul 12 '16 at 18:14
  • I've tried looking at it a couple of different ways, the problem has to do with authentication. The web browser (IE) will automatically authenticate, but it doesn't hold it so I can make the drive. – pheeper Jul 13 '16 at 22:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.