Excel VB.net Add-in regenerate custom TaskPane

Murray Brown
Murray Brown used Ask the Experts™
on
Hi

I use the code below to add a custom task pane. I need to erase the task pane so that I can add it at a later point. How do I delete a taskpane so that I can use the code below to add it again?


   Private oTaskPane_Select As TaskPane_Select
    Public WithEvents Select_CustomTaskPane As Microsoft.Office.Tools.CustomTaskPane

 Private Sub ThisAddIn_Startup() Handles Me.Startup

          oTaskPane_Select = New TaskPane_Select()
            Select_CustomTaskPane = CustomTaskPanes.Add(oTaskPane_Select, "SELECT Elements")
            Select_CustomTaskPane.DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionBottom
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Hi murbro, would the CustomTaskPanes.Remove method work for you? Here is an example (for Word but quite similar) showing the method in action:
How to Create a Word Addin using Visual Studio
Hope that helps
...Terry
Murray BrownASP.net/VBA/VSTO Developer

Author

Commented:
Yes. thanks very much

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial