View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Alain-79 Alain-79 is offline
external usenet poster
 
Posts: 16
Default How to Connect a network Drive

yes I know that too but on a daily basis they are
1 - not changing such things so often
2 - used to work with the Network Drive letter rather than with the absolute
path they even do not know at all

This is what I consider I should continue to present them what they know the
most...

Thanks once more to you
Regards
Alain

"Jacob Skaria" wrote:

There is always a possibility that the user change the drive mapping to
something else. So it is always better to use the UNC path either stored in
an .ini file or if in VBA stored in a dedicated sheet/cell so that you dont
need to be 'drive letter' dependent.

--
Jacob


"Alain-79" wrote:

I know I can do that but the problem is that up to now I have not kept the
absolute path starting with \\server\...

I have just made a list of potential path that could be used but those path
are just kept whith their Network Drive letter, not with their full path...
And then when then Network Drive my users will like to use is not connected I
have no way up to now to provoce the re-connection, not no way to recover the
full path... except if this last one would be available somewhere like in a
Registry key...

The unique solution I can imagine at the moment is to keep a memo of the
full path in // to the logical path at the time it is entered in my list...
Then I will be able to reconnect it using net use or any other possible
function for that task...

Thanks for your input
Alain

PS regarding your code proposal
thanks to remember I cannot access the full path
mine is a follow

set fso = CreateObject("Scripting.FileSystemObject")
set objFolder = GetFolder(Z:\SharedFolder)
Z is here a map drive I created through Explorer

the <<set objFolder code line produces an error if the Network Drive is
not connected which is systematically the case just after login...
If you go to the explorer and click inside the Z drive = it open it
Then the same code lines will not produce any errors...