none
Custom task pane in a template project? RRS feed

  • Question

  • Hi

    is it possible to have a custom task pane in an Excel template project? Seems to me it's not possible but I rather ask here to be sure.

    I've developed an Excel Addin with 2 custom tasks panes but now we've decided to change it from the Add-in project to template project. I haven't started to change it yet but seems to me that is not possible to call this

    Microsoft.Office.Tools.CustomTaskPane cpActive = Globals.ThisAddIn.CustomTaskPanes.Add(customControl, "Title");
    

    I haven't found any object that allows me to use CustomTaskPanes in a template project. So I would say I have to rewrite the custom task panes to standard userforms.

    Am I right?

    Thanks

    Pat

     


    Visual Studio 2010 Professional, Office 2007
    Monday, December 12, 2011 2:23 PM

Answers

  • Hi Pat

    You are correct: a Custom Task Pane can not be part of a VSTO document-level customization. Document-level customizations use the Actions Pane, which provides the same basic functionality. You can implement your customControl UserControl pretty much the same way with an ActionsPane, but the syntax is slightly different because the ActionsPane can't be used by any window but the one for the document-level customization.

    You may also need to minimally adjust code in the UserControl if it does any manipulation in Excel. Globals.ThisAddin won't work, it would be more like Globals.ThisWorkbook...


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by PetLahev Monday, December 12, 2011 4:09 PM
    Monday, December 12, 2011 3:58 PM
    Moderator

All replies

  • Hi Pat

    You are correct: a Custom Task Pane can not be part of a VSTO document-level customization. Document-level customizations use the Actions Pane, which provides the same basic functionality. You can implement your customControl UserControl pretty much the same way with an ActionsPane, but the syntax is slightly different because the ActionsPane can't be used by any window but the one for the document-level customization.

    You may also need to minimally adjust code in the UserControl if it does any manipulation in Excel. Globals.ThisAddin won't work, it would be more like Globals.ThisWorkbook...


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by PetLahev Monday, December 12, 2011 4:09 PM
    Monday, December 12, 2011 3:58 PM
    Moderator
  • Thanks a lot Cindy!!

    I'll take a look on the ActionsPane

    Pat


    Visual Studio 2010 Professional, Office 2007
    Monday, December 12, 2011 4:09 PM