Is there some event in the .net automation libraries that can detect when the user who is working on the excel file, has run a macro?
For example, the user opens an excel document which contains an macro, than he runs the macro and the .net application, that is attached to that excel process detect the start macro event?
or maybe bind the macro function to a delegated event in the application..
edit:
Can the 'Run Macro' CommandBarControl click event be caught from the code behind?
Right-click the macro in the Navigation Pane, and then click Design View. On the Design tab, in the Tools group, click Single Step. Click Run. If the macro is a new or edited macro, you will be prompted to save the macro before you can run it.
Using Auto open method to run a macro automatically: Insert a New Module from Insert Menu. Copy the above code and Paste in the code window. Save the file as macro enabled workbook. Open the workbook to test it, it will Run a Macro Automatically.
Having never done this myself, I can't say for sure how you would define that specific application event, but this page here gave me some useful information on defining your own events through class modules. http://www.cpearson.com/excel/Events.aspx
edit: The whole page is on events, to read about defining your own scroll down about 4/5 of the way.
I do not know if there is 'an event' in the .NET
automation but I know TrackToAct.com (full disclosure my co.) has a VBA
code snippet or DLL
that your drop into track events. It enables you to tag events and report on the usage via web dashboard.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With