I've got a VBScript that I can run manually without an issue. It opens and Excel doc, runs the macro, saves as a different file type and closes out of excel.
Dim ObjExcel, ObjWB
Set ObjExcel = CreateObject("Excel.Application")
Set ObjWB = ObjExcel.Workbooks.Open("C:\Scripts\ExcelTest.xlsm")
objExcel.DisplayAlerts = FALSE
objExcel.Visible = FALSE
ObjWB.Application.Run("RefreshData")
objWB.SaveAs "C:\Scripts\ExcelTest.xlsx", 51
objExcel.Application.Quit
Set objExcel = Nothing
However when putting this in Task Scheduler it opens Excel (in background) but never finishes. The user running has Admin rights and I've tested the VBS with that user as well. I can see that Excel is opening as it remains open in task manager, and task times out after 3 minutes per the task scheduler limit.
In short - its opening the file, but I can't figure out why it wont run the macro and save. Thanks