How to open a password protected excel file using VBScript?
sPath = "c:\test\test.xls'
oExcel.Workbooks.Open sPath
this opens the excel file but asking for password. (the test.xls is
password protected). To open the excel I need to give the password
everytime. Is there a way to pass the password in code, so that the
clients will not get annoyed by the password request popup everytime?
thanks
Ausdruck.Open( FileName,
UpdateLinks,
ReadOnly,
Format,
Password,
WriteResPassword,
IgnoreReadOnlyRecommended,
Origin,
Delimiter,
Editable,
Notify,
Converter,
AddToMRU
)
so
Set oWBook = oExcel.Workbooks.Open( sPath,,,,sPassW )
should work (not tested; check your Docs and my ","s carefully). But why
protect c:\test\test.xls if you do extra work to allow unlimited access
for everybody who can run or read your script?