Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is the answer I found...
At the time I need to to the getFolder on a path (pathToCheck) based on a network drive (Z) that can be disconnected, - I first recover the remotePath from the registry key... Dim oShell As Object: dim remPath$ Set oShell = CreateObject("WScript.Shell") remPath= oShell.RegRead("HKEY_CURRENT_USER\Network\Z\Remote Path") - second I map it again - this will re-connect in case not Dim objWSNet As Object, strDrive As String, strUNCPath As String Set objWSNet = CreateObject("WScript.Network") objWSNet.MapNetworkDrive Z:, remPath - then I can do my getFolder which will fail only if I am not connected to the network... fld = fso.GetFolder(pathToCheck) Thanks to the ones who answered... Regards Alain "Alain-79" wrote: Using fso, I need to be able to make a getFolder on several possible path including Network Drives... but when one of them is not connected I get an error... It's rather simple to open the explorer and to click on this network drive in order toget it connected... but how can I automate this through vba code... In other words: How can I through vba connect an existing network drive and this even if I have just the logical path such as Z:\Folder Using <<Net Use would imply I have kept the network path such as \\server\...\shared folder or at least that I am capable of recovering it... Thanks for any potential help... Regards Alain |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Network drive | Excel Worksheet Functions | |||
map network drive | Excel Programming | |||
Using An Add-in On A Network Drive | Excel Programming | |||
Link workbooks-C drive to network drive | Excel Worksheet Functions | |||
Userform Local Drive & Network drive question | Excel Programming |