I have been given a spreadsheet with an ActiveX control button to execute a complex macro that I can't see the VBA code for because it is password protected. I need to loop through 1000 input values using the ActiveX button. Is there a way to code the part where I click the button in VBA or R?
Here's what I would like to achieve:
I need help with step 2.
You can use Application.Run
here, specifying the workbook name, the sheet code module, and the click handler:
Dim i as Long
For i = 1 to 1000
Application.Run "'WorkbookName.xlsm'!Sheet1.RunSimulation_Click"
Next