Excel automation, how to detect if user runs macro in excel worksheet or clicks 'Run Macro' CommandBarControl?

Answered Excel automation, how to detect if user runs macro in excel worksheet or clicks 'Run Macro' CommandBarControl?

  • Wednesday, September 19, 2012 12:11 PM
     
     

    Is there some event in the  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..

    Can the 'Run Macro' CommandBarControl click event be caught from the code behind?

All Replies

  • Thursday, September 20, 2012 10:51 AM
    Moderator
     
     Answered

    Hi Zdrsh,

    Thank you for posting in the MSDN Forum.

    It based on my experience that there's no such an event to directly detect whether a macro has run. Nor could you catch the 'Run Macro' CommandBarControl click event.

    I think you'll need to find other ways for your request.

    Hope it helps.

    Best regards,
    Quist


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us