View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Teddy[_3_] Teddy[_3_] is offline
external usenet poster
 
Posts: 8
Default Save active sheet as "filename" on a remote server with username and password

Hi gurus

(I know many of you are :-)

How do I sav a file on a network server I am not mapped up to?
I must provide a username and password.
How do I set in username and password for the server into the code???

v_FULLPATH_FILE_NAME =\\servername\driveletter$\folder\subfolder
\filename"

Application.ScreenUpdating = False
Inst.Copy ' name of the sheet
With ActiveSheet.Parent
Application.DisplayAlerts = False
.SaveAs Filename:=v_FULLPATH_FILE_NAME, FileFormat:=xlText
.Close SaveChanges:=False
Application.DisplayAlerts = True
MsgBox "Data saved"
End With
Application.ScreenUpdating = True