Schedule to trigger macro to run automatically on a specific time/date

  • Hi

    While I'm trying to schedule and trigger a macro of a sample test file, I could setup a .vbs file and a bat file that has following code that I learnt from a yt video. When I ran the batch file and checked my macro workbook to see if the changes are reflected, I get an error message saying 'workbook is locked for editing by me'. It doesn't make sense to me as I don't have any workbooks opened at the moment.

    I do have cscript.exe on my machine

  • I just cleared all the excel files in background. Now the bat file is executing but the macro isn't running i.e.., the changes aren't reflecting on the spreadsheet for some reason.

    Below is the bat file code:

    1. cscript script.vbs "C:\Users\rar\dev\TestMacro\Test\Sample.xlsm"
  • Try this