Hi

I have the following code that worked until the excel workbook was required to be password protected. It fails when I added the password attribute.

Option Explicit


Dim xlApp, xlBook


Set xlApp = CreateObject("Excel.Application")
'~~> Change Path here
Set xlBook = xlApp.Workbooks.Open("\\server\a\Rota.xlsm", 0, True, Password:="1234")


xlApp.Run "CreateOpsRota"
xlBook.Close
xlApp.Quit


Set xlBook = Nothing
Set xlApp = Nothing


WScript.Echo "Finished."
WScript.Quit
Any help really appreciated.

Thanks