VBA
Control scripts from VBA
Last updated
Control scripts from VBA
Last updated
The XLConnect add-in can be controlled from VBA for a better user experience when users click on a button, doubleclick a cell, change a value etc.
Below is an example that runs the script named "Pull TrialBalance"
Import script "Connections"
On the Insert
ribbon of Excel, insert an Icon
Right-click the icon and select Assign Macro...
In the Assign Macro screen, select New
This should bring you to the VBA editor. If not, press ALT-F11.
Paste in the two lines so your code looks like this:
Make sure the name of the VBA method corresponds to the name in the Assign Macro
editor in Excel (in this case Graphic2_Click
).
Go back to Excel and click the icon, that should now run the Graphic2_Click VBA method, that will execute the Connections script.
This is how simple it is to execute a script by clicking an icon.