I’m trying to get a macro to run each week via the task scheduler and I’ve never done this before. I googled it and found some code, but some of it wouldn’t allow me to get past the security halt for executing a macro. At least this code doesn’t do that, but it only pulls up the workbook and I never see any execution of the macro. I hoping someone here can help.

The workbook is this case is named Acronis Backup check.xlsm and the macro inside it is Backup_Check. I created a folder and put the workbook and a run.bat and a script.vbs file in there, and am trying to execute the run.bat file. As I said it’ll put up the workbook but nothing ever happens with the execution of the macro. Then if I close the open workbook Excel crashes and restarts.

Here’s the code in script.vbs:
Dim args, objExcel

Set args = wscript.Arguments
Set objExcel = CreateObject("Excel.Application")

objExcel.Workbooks.Open args(0)
objExcel.Visible = True

objExcel.Run "Acronis Backup Check!Backup_Check"

objExcel.Activeworkbook.Save
objExcel.Activeworkbook.Close(0)
objExcel.Activeworkbook.Quit
Here’s the code in run.bat:
cscript script.vbs "C:\_Excel Macro Scripts\Acronis Backup Check.xlsm"
Any idea how I can get a macro to run via scripting so I can execute it via the task scheduler?