chrisandsally
New Member
- Joined
- Feb 6, 2015
- Messages
- 4
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.
Any help really appreciated.
Thanks
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.
Code:
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