FileSystemObject CopyFile with UserID/Password
I have a shared folder mapped on my computer. Access to
the shared folder requires an UserID/Password. I have this code that will copy a file from my computer to the shared folder. My objective is to have the code run when I am not logged in. Sub CopyUpdateToFolder() Dim filesys Set filesys = CreateObject("Scripting.FileSystemObject") If filesys.FileExists("C:\View\Sample Report.xls") Then filesys.CopyFile "C:\View\Sample Report.xls", "\\OtherServer\View\Sample Report.xls" End If End Sub As long as I'm sitting here logged in to my computer and to the shared folder, this code works. However when I am not logged in, the code is going to fail because it does not supply the UserID/Password for the shared folder. How do I pass this information in the code. Thanx, tod |
All times are GMT +1. The time now is 01:32 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com