none
Excel Add-ins interfering RRS feed

  • Question

  • I have two independent Excel Add-ins deployed via click-once. Each Add-in's needs to automatically activate their UI based on changes to activesheet event in any workbook and both use event handlers of the form.

    ((Excel.

    AppEvents_Event)_excel).NewWorkbook += this

    .NewWorkbook;

    _excel.WorkbookOpen +=

     

    this

    .AddWorkbook;

    _excel.WorkbookActivate +=

     

    this

    .ActiveWorkbookChanged;

    _excel.SheetActivate +=

    this

    .ActiveSheetChanged;

    When both Add-ins are installed, only one of the add-ins is ever activated. It looks like only 1 of the handlers is called by excel, despite multiple handers being added. 

    What is the recommended way to design independent application add-ins to support auto-activation based on sheet selection?

    Thanks

    >>>> Update 1 <<<<<

    Interestingly, if I run two instances of Excel and enable a different add-in in each, then they can both work.  Anyone,  got any ideas what could be causing the failed behaviour when both run under a single excel instance?

    >>>> End of Update 1 <<<<<

     



    • Edited by jedlewis Friday, November 11, 2011 2:02 PM
    Friday, November 11, 2011 9:40 AM

Answers

  • Hi,

    Thanks for your post.

    I have created two Excel add-in with almost the same code, the only difference between the two add-ins is the string to display in the MessageBox.Show method which is called within each event hanlders.

    The events handlers are triggered without any exception, and it seems that the same events are triggered as the order that the corresponding add-in load.

    The most pobably reason why these two add-ins don't work in your side I can tell it that the procedures for the same event casuing something like "crash", "override".

    Would you like show me your events handlers here, maybe we can find out the problem for this issue.

    Good day,


    Best Regards, Calvin Gao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by jedlewis Wednesday, November 16, 2011 12:27 PM
    Tuesday, November 15, 2011 8:09 AM
    Moderator