MapNetworkDrive

Tom_H

New Member
Joined
Feb 9, 2017
Messages
24
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.

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:

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Re: Get stuck on MapNetworkDrive

The preferences and libraries are the same and have the same priority in both files.
 
Upvote 0
Re: Get stuck on MapNetworkDrive

According to the SharePoint team at our company MapNetworkDrive is too instable to use. They will find a better way to do it on our environment.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,331
Members
452,636
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top