I'm struggling with macros and I can't seem to find what I'm doing wrong.
I have a .vbs file with the following content:
Sub TestMacros()
Application.ScreenUpdating = False
Workbooks("mock_data_template.xlsx").Worksheets("data").Activate
Range("G2").Value = 1
Range("G3").Value = 2
Range("G4").Value = 3
Application.ScreenUpdating = True
End Sub
The Excel file is super simple
All the trust settings are enabled. I created the macro above just to test the launch from cmd.
In the cmd, I type:
cscript "full-path-to-.vbs" "full-path-to-.xlsx" "TestMacros"
It doesn't return any error but there's no any result in the .xlsx file.
Could you please tell me what I'm doing wrong?
My general goal is I want to have a macros that I will apply to a constantly extending bunch of .xlsx files. I don't have macros inside those files (I download them), I can't change it in any way. But I have a script and I want it to be applied to an .xlsx file