none
Hw can I use one of my ribbon button from VSTO Excel custom task pane's button ? RRS feed

  • Question

  • Hi, the beginner again.

    I have my first button on the VSTO Excel Ribbon.
    Now, I made second button on the custom task pane with VSTO Excel.

    I would like to call/use/click the first one from the second one.
    What do I have to do ?
    If I click the second one, then, the first one has to work.

    Regards

    Wednesday, March 25, 2015 4:43 AM

Answers

  • Hello,

    There is no way to execute custom controls programmatically. Instead, you can access the add-in class from the task pane using the Globals.ThisAddin property and run the Click event handler directly.

    Note, you can run built-in controls programmatically using the ExecuteMso method of the CommandBars class. This method is useful in cases where there is no object model for a particular command.  Works on controls that are built-in buttons, toggleButtons and splitButtons.

    Wednesday, March 25, 2015 12:01 PM

All replies

  • And this is the codes.

    Wednesday, March 25, 2015 4:44 AM
  • Hello,

    There is no way to execute custom controls programmatically. Instead, you can access the add-in class from the task pane using the Globals.ThisAddin property and run the Click event handler directly.

    Note, you can run built-in controls programmatically using the ExecuteMso method of the CommandBars class. This method is useful in cases where there is no object model for a particular command.  Works on controls that are built-in buttons, toggleButtons and splitButtons.

    Wednesday, March 25, 2015 12:01 PM
  • Thanks for the reply.

    Hmm. That is so disappointing.

    Globals.ThisAddin has not so much measures for me.

    Anyways, that is nice info. to me.

    Regards

    Wednesday, March 25, 2015 1:09 PM