Saturday, April 10, 2010

VBScript - How Can I Remove the Password When Opening an Excel Spreadsheet?

VBScript - How Can I Remove the Password When Opening an Excel Spreadsheet?

Set objExcel = CreateObject("Excel.Application")

objExcel.Visible = TRUE
objExcel.DisplayAlerts = FALSE

Set objWorkbook = objExcel.Workbooks.Open("C:\Scripts\Test.xls",,,,"L$6tg4HHE")

objWorkbook.Password = ""
objWorkbook.SaveAs "C:\Scripts\Test.xls"

[Via]