Hi
I have a tiny file that list all files from a SharePoint directory (https: )
When I run the macro it stop on : objNet.MapNetworkDrive "A:", myDir
Error: "The operation being requested was not performed because the user has not been authenticated."
But if I open another file (and do nothing, only minimizing the window) the macro in the first file is working.
And even if I close the second file it still works. But if I close the file, open and run the macro again it wont work.
I guess there is something happening when the other file is loaded. Dll's , security settings , Windows registry .. ?
Please help or tip what to look for.
I have checked all the preferences and have the same priority order in both files.
I have a tiny file that list all files from a SharePoint directory (https: )
When I run the macro it stop on : objNet.MapNetworkDrive "A:", myDir
Error: "The operation being requested was not performed because the user has not been authenticated."
But if I open another file (and do nothing, only minimizing the window) the macro in the first file is working.
And even if I close the second file it still works. But if I close the file, open and run the macro again it wont work.
I guess there is something happening when the other file is loaded. Dll's , security settings , Windows registry .. ?
Please help or tip what to look for.
I have checked all the preferences and have the same priority order in both files.
Code:
On Error Resume Next
objNet.RemoveNetworkDrive "A:", True
On Error GoTo 0
myDir = Sheets("Dir").Cells(1, 2)
objNet.MapNetworkDrive "A:", myDir '<-- get stuck! :(
Set objFolder = FSO.GetFolder("A:")
r = 1
For Each objFile In objFolder.Files
tbl.DataBodyRange.Cells(r, 2) = objFile.Name
tbl.DataBodyRange.Cells(r, 1) = objFile.DateLastModified
r = r + 1
Next
Last edited: