I have set up a .bat file to open an excel workbook that I need to run at 1:00 AM. The file is a .xlsm that I am using to generate a report. I can run the excel file manually and it works. I created a .vbs file to start the .xlsm file, and it works. I created a .bat file to run the .vbs file and it works as well. When I try to run the .bat file from a scheduled task, I can see the task status show running and then completed, but the report is not generated. I am not sure what the problem could be.
This is the .bat file.
cscript "C:\REP_Reports\Report Design\vbScripts\vbsMRT.vbs"
This is vbsMRT.vbs.
on error resume next
Set objExcel = CreateObject("EXCEL.APPLICATION")
objExcel.visible = true
Set objWorkbook = objExcel.Workbooks.Open("C:\REP_Reports\Report Design\2MARYMO_MRT01R01.xlsm")
Set objWorkbook = Nothing
Set objExcel = Nothing