The Problem Solver

Tell me and I will forget
Show me and I will remember
Involve me and I will understand
- Confucius -

Google Ads

This Blog

Syndication

Search

Tags

News





  • View Maurice De Beijer's profile on LinkedIn

Community

Email Notifications

Explore

Archives

VSTO Excel solutions and disappearing Action Panes
If you are using Actions Panes in a VSTO Excel add-in you might have seen the following behavior. You create an new ActionPane, derived from UserControl, and add it to the Workbook ActionsPane.Controls collection. It shows up nicely so you think you are done.
 
Now the user creates a new Spreadsheet using File/New. Note that the ActionsPane disappears and remains hidden until the user reactivates it using View/Task Pane or Ctrl+F1.
 
So how do you automatically display the TaskPane when the user switched back to the original document? You need to add the following code to the ThisWorkbook type:
 
PrivateSub ThisWorkbook_WindowActivate(ByVal Wn As Window) HandlesMe.WindowActivate
    Application.DisplayDocumentActionTaskPane = True
EndSub
 
Enjoy!
 
Published Fri, Feb 16 2007 19:55 by Maurice
Filed under: , ,

Comments

# re: VSTO Excel solutions and disappearing Action Panes@ Wednesday, April 22, 2009 3:00 AM

Tnx, the C# code is:

   private void InternalStartup()

       {

          this.WindowActivate += new Excel.WorkbookEvents_WindowActivateEventHandler(ThisWorkbook_WindowActivate);

       }

private void ThisWorkbook_WindowActivate(Excel.Window Wn)

       {

           Application.DisplayDocumentActionTaskPane = true;

       }

by Gi

# halseymiln@ Thursday, June 11, 2009 11:37 AM

increases responsible costs future agreement north