Excel 2013 closes an ExcelTaskPane instance and then opens it when a new Excel worksheet is created at runtime

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

Excel 2013 closes an ExcelTaskPane instance and then opens it when a new Excel worksheet is created at runtime
 
David R.




Posts: 55
Joined: 2010-07-22
As per this forum topic ( https://www.add-in-express.com/forum/read.php?FID=5&TID=13755 ) which I originally opened and had resolved using the supplied update to Add-In-Express, the Excel ADXTaskPane is closing and opening when a new Excel worksheet is created at runtime in Excel 2013. This behaviour doesn't happen in prior versions of Excel. I have not yet tested Excel 2016.
Posted 15 Nov, 2016 15:15:39 Top
David R.




Posts: 55
Joined: 2010-07-22
Here's a http://s000.tinyupload.com/index.php?file_id=18133392158232425762 that shows the behaviour. In the video note that the third radio button in the list in the "List Option" group is selected. When the OK button is click in the Templates group a new worksheet is created which closes the ADXExcelTaskPane. When the new worksheet code has completed the ADXExcelTaskPane is opened at the 13 second mark in the video the first radio button in the list in the "List Option" group is selected, indicating that the form was closed and then opened not hidden and then shown since the existing properties were reset.
Posted 15 Nov, 2016 15:26:12 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Hello David,

I cannot reproduce the issue using this test project: http://temp.add-in-express.com/support/MyAddin193-AdxExcelPane.zip. Could you please modify it so that the issue is reproducible and send the project to the support Email address? You can find the support email address in {Add-in Express installation folder}\readme.txt. Please make sure your email contains a link to this topic.


Andrei Smolin
Add-in Express Team Leader
Posted 16 Nov, 2016 07:22:13 Top
David R.




Posts: 55
Joined: 2010-07-22
The solution you provided is for VS2015. My solution is compiled with VS2010, using .Net Framework 4 provided with VS2010 with Add-In-Express version 8.1.4353.2005. Since the previous resolution to this problem was to install the latest version of Add-In-Express which is at 8.3.xxxx I should probably follow those steps first.
Posted 16 Nov, 2016 11:22:36 Top
David R.




Posts: 55
Joined: 2010-07-22
http://s000.tinyupload.com/?file_id=00444673606571276217 that was made with VS2010 and the latest Add-In-Express.
Posted 16 Nov, 2016 14:08:27 Top
David R.




Posts: 55
Joined: 2010-07-22
Here's a video of the sample project running in Excel 2010:
http://s000.tinyupload.com/?file_id=03683750905879187409
In this video I click on the Create Excel WS button many times, and each time a new worksheet is created, which Excel hosts within a separate Excel workbook container, but at no time is the ADXExcelTaskPane reloaded because there's no trigger of the 5 second pause in the Load event.

Here's a video of the sample project running in Excel 2013:
http://s000.tinyupload.com/?file_id=23548414967925995697
In this video I click on the Create Excel WS button two times, and each time a new worksheet is created which Excel hosts within a separate Excel workbook container, but note that the ADXExcelTaskPane is reloaded which is evident by the 5 second pause in refreshing the task pane.
Posted 16 Nov, 2016 14:42:21 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Hello David,

I've set adxExcelTaskPanesCollectionItem1.Enabled = true and modified the code as follows. First off I introduced a boolean flag that controls the visibility of the pane.

        public bool letPaneShow = false;
        private void adxRibbonButton1_OnClick(object sender, IRibbonControl control, bool pressed)
        {
            letPaneShow = true;
            adxExcelTaskPanesCollectionItem1.ShowTaskPane();
        }


and

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


Then I commented out the Wait method and the corresponding call.

Now, when I click the Ribbon button in Excel 2010, the pane gets shown. When I click the button on the pane, this creates a new workbook while the pane is displayed all the time.

David R. writes:
each time a new worksheet is created, which Excel hosts within a separate Excel workbook container


There's a single workbook container window in Excel 2010 because Excel 2010 is an MDI window: it contains all workbooks within the same main window. Excel 2000-2010 implement MDI, while Excel 2013-2016 implement SDI.


Andrei Smolin
Add-in Express Team Leader
Posted 17 Nov, 2016 10:08:34 Top
David R.




Posts: 55
Joined: 2010-07-22
I will implement your suggestion.

On further testing, I have discovered that the Excel task pane is initialized and the form's load event is called each time a new worksheet is added to the workbook. The purpose of the Wait() method was to prove that form load event is being called. In addition, I uninstalled Office 2013 and installed Office 2010 to the computer and Office 2010 on this computer has the behaviour, with the form's load event being called when a new worksheet is added to the workbook. The computer is running Windows 10.

I am not seeing this behaviour on Windows 7 computers, but will need to create a development environment based on Windows 10.
Posted 17 Nov, 2016 11:04:44 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Hello David,

I'm sorry, I don't follow. What does "this behaviour" mean?

David R. writes:
I uninstalled Office 2013 and installed Office 2010


Please make sure you have an only Office version on the machine. If you have another Office (or separate applications from other Office versions) installed, this may produce issues that cannot be solved programmatically. At the very least, the Office versions should be installed in the natural order.


Andrei Smolin
Add-in Express Team Leader
Posted 18 Nov, 2016 07:37:51 Top