Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Mapping Network Drive

  Asked By: Joel    Date: Feb 23    Category: MS Office    Views: 657
  

I am using Excel 2000/2003. I am currently doing a program which will
map to a network drive.

The program should be able to
- map to the drive with the user ID and password
- detect if the login is successful. If it is not, it should have a
error message.

If it is possible, I would like to be able to map to another drive if
the current one is taken up. Eg I am mapping to S:\ but S:\ is taken
up. Maybe the program would be able to select T:\

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Aabirah Khan     Answered On: Feb 23

I can offer you a partial solution. This code will map  a drive  if it
can. The error portion of the code you can attempt a different drive,
or whatever.

Sub Map()
On Error GoTo MapError

Set Map = CreateObject("WScript.Network")
Map.MapNetworkDrive "F:", "\\server\folder", , "UserName", "Password"

Set Map = Nothing

MapError:
MsgBox ("F is connected already")

End Sub


I'm not  sure how to verify password/username accuracy.

 
Answer #2    Answered By: Utsav Shah     Answered On: Feb 23

Is there anyone who can add on to his solution?

 
Didn't find what you were looking for? Find more on Mapping Network Drive Or get search suggestion and latest updates.




Tagged: