Event 'AddinStartupComplete' not firing in Excel 2010

Add-in Express™ Support Service
That's what is more important than anything else

Event 'AddinStartupComplete' not firing in Excel 2010
 
Daniel Wosch


Guest


Good morning everybody, i recognized an problem using our Excel AddIn in Excel 2010 and above.
It seems like the event blue is not firing in Excel 2010 and above.

The event declaration looks as following:
this.AddinStartupComplete += new AddinExpress.MSO.ADXEvents_EventHandler(this.ToolbarAddinStartupComplete);


We use this event to hide our TaskPane on the right side of excel:


if(this.taskPanesCollection.TaskPaneInstances.Count > 0)
{
     this.taskPanesCollection.TaskPaneInstances[0].Hide();
}


As the event is not firing under Excel 2010 the taskpane is always visible after Excel starts but the approach is to show the taskpane only when the user clicks an button in the Excel ribbon toolbar.

We also tried to use the
AddinInitialize
event but it shows the same behavior.

Thanks in advance for your support.
Kind regards

Daniel
Posted 18 Aug, 2015 01:25:11 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hello Daniel,

I suppose what you see is a result of this.taskPanesCollection.TaskPaneInstances.Count being zero in the AddinstartupComplete event. We recommend to use the ADXExcelTaskPane.ADXBeforeTaskPaneShow event to control the visibility of the task pane instance: you can set ADXExcelTaskPane.Visible=false in this event.


Andrei Smolin
Add-in Express Team Leader
Posted 18 Aug, 2015 01:32:29 Top
Daniel Wosch


Guest


Thanks for your really fast reply Andrej.
I'll try that out and post the result here.
Posted 18 Aug, 2015 01:50:13 Top
Daniel Wosch


Guest


Hey Andrej,
I've tried your approach but something seems to go a little bit weird.


  private void TrendDetectionTaskPane_ADXBeforeTaskPaneShow(object sender, ADXBeforeTaskPaneShowEventArgs e)
        {
            // See: https://www.add-in-express.com/forum/read.php?FID=5&TID=13283
            // for further informations
            // Hide the taskpane on excel startup
            this.Visible = false;
        }


After implementing your approach the Load event is not firing any more which contains some initialize methods which are needed.

this.Load += new System.EventHandler(this.TrendDetectionTaskPaneLoad);


Further if i click on a button in the ribbon and calling the blue method or setting blue does not show the taskpane. Maybe i am missing something?

PS: Tested under Excel 2007 and 2010
Posted 18 Aug, 2015 02:17:03 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Daniel,

You need to use a flag to set this.Visible=false or this.Visible=true depending on the actual situation. The Load event will occur when the form is permitted to show.


Andrei Smolin
Add-in Express Team Leader
Posted 18 Aug, 2015 03:55:54 Top
Daniel Wosch


Guest


Andrei,
sorry - i don't get it. Maybe its to early in the morning.

Okay - back to the roots:
- Excel Starts --> Hide the TaskPane which is located on the right side
- Button in Toolbar clicked --> Show TaskPane

Shouldn't be to complicated to implement?
Posted 18 Aug, 2015 04:13:39 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
To show/hide the pane, I use the following event handler of the ADXBeforeTaskPaneShow event:

private void ADXExcelTaskPane2_ADXBeforeTaskPaneShow(object sender, ADXBeforeTaskPaneShowEventArgs e) {
    this.Visible = _ExcelPanes.AddinModule.CurrentInstance.letPaneShow;
}


letTaskPaneShow is a public property defined in the add-in module. If it returns false at startup, the pane won't show (Excel will not show the pane at startup). If, later on, the add-in module calls myAdxExcelTaskPanesCollectionItem.TaskPaneInstance.Visible = true, the pane will only show if letPaneShow returns true. If the pane is allowed to show, the AdxExcelTaskPane.Load event will occur after ADXBeforeTaskPaneShow event.


Andrei Smolin
Add-in Express Team Leader
Posted 18 Aug, 2015 04:37:56 Top
Daniel Wosch


Guest


Hello,
sorry but i am not able to find _ExcelPanes in my Pane.
Posted 18 Aug, 2015 05:51:53 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Ah, I see. That code that refers to my project named _ExcelPanes. You need to use your project name instead.


Andrei Smolin
Add-in Express Team Leader
Posted 18 Aug, 2015 06:07:10 Top
Daniel Wosch


Guest


Hello Andrei,
ahh okay - it made *click* in my head!

The "letPaneShow" property is an manually implemented property inside the
AddinExpress.MSO.ADXAddinModule
and not an already implemented property of the AddInExpress Framework. I guess that was my understanding problem.

I'm a little bit confused today so sorry if my question seem to be kinda stupid, but where do i set the 'letPaneShow' property to true? You need to know that our Excel AddIn is splitted into to separate projects. One project is the AddIn which contains the Excel UDFs and the other project contains the TaskPane and the Excel ribbon. Further, there is no reference between both. So both projects don't know each other.
Posted 18 Aug, 2015 08:39:37 Top