gnaga
05-24-2011, 01:54 PM
My current macro is running in one of the network PC with User-A login. When I execute the follwoing line, I get an error as User-A is not having access to view this file.
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.Getfile("//XXXXX/XXXXX/ABC.xlsm")
Set SrcBook = Workbooks.Open(f)
Just before executing this code, can we change windows logon Username and password to another user say User-B who has the access to this file?
Finally I would like to revert back to User-A logon.
__________________
Regards
GNaga
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.Getfile("//XXXXX/XXXXX/ABC.xlsm")
Set SrcBook = Workbooks.Open(f)
Just before executing this code, can we change windows logon Username and password to another user say User-B who has the access to this file?
Finally I would like to revert back to User-A logon.
__________________
Regards
GNaga