I have a scheduled task that runs on a Windows Server 2003 machine that runs a .vbs job. This job has been running successfully for 6 months. Last weekend the job started failing. I am unaware of any changes on the server. Though the job is not producing the desired results, the Scheduled Task indicates it completed successfully. If the job is run from a command line it is successful. Googling around I found an article that suggested running the job from a batch file and collecting the results in a log file. Doing so, the job produced this error:
77, 1) Microsoft Office Excel: Unable to get the Add property of the Workbooks class
The applicable code is below. I don't understand why this worked for so long and is failing now, only in Scheduled Tasks. I've attempted to run it from cscript to no avail. Any help will be greatly appreciated.
76 Set objExcel = CreateObject("Excel.Application")
77 Set objWB = objExcel.Workbooks.Add
78 Set objSheet = objWB.Sheets("Sheet3")
80 Set objSheet = objWB.Sheets("Sheet2")
82 Set objSheet = objWB.Sheets("Sheet1")
83 objsheet.name = "Data"