View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default map network drive

Something like:

Sub map_um()
dq = Chr(34)
s = "net use z: /delete /y"
ss = "net use z: " & dq & "\\MAINSERVER\Shared" & dq & " /PERSISTENT:no"
x = Shell("cmd.exe /c" & s, 1)
x = Shell("cmd.exe /c" & ss, 1)
End Sub

Note I use the variable dq as I always have trouble embedding double quotes
in a string.
--
Gary''s Student - gsnu200790


"lumpy04" wrote:

Hello,

I would like to map a network drive when I open the worksheet. Something Like

Private Sub worksheet_open()
Net use y: \\server\share password /user ID
end sub

Can anyone help?