I have a routine in excel vba which retrieves files and file listings from a sharepoint server, in order to pull specific data from multiple files. This works great if the user has gone to the server in windows explorer beforehand (entering \server.address.com\Directory\Folder\Structure\ in the address bar) and logging in using the windows login information.
If the user hasn't logged on to that since restarting, the system throws an error because it cannot access the file system on the sharepoint server.
I thought I would be able to open an explorer window using shell:
Shell "explorer.exe /e, \\server.address.com\Directory\Folder\Structure\", vbNormalFocus
But it simply opens up in the user's documents folder if they haven't logged in yet. I also tried using the file system object to connect to the folder, hoping for a prompt then:
Dim FSO As Object, FLD As Object
Set FSO = CreateObject("scripting.filesystemobject")
Set FLD = FSO.GetFolder("\\server.address.com\Directory\Folder\Structure\")
But no joy.
Also, there are no spaces in the directory structure, so I haven't need to escape the path (though I did try anyways).
I also tried forcing the user to map the folder in windows explorer, from the drivemapper code found at Get the content of a sharepoint folder with Excel VBA but I get the error "The operation being request was not performed because the user has not been authenticated."
Any idea what else I can try in order to authenticate the end users without having them all add sharepoint to their explorer favorites (my manual workaround).
Thanks