AdxExcelTaskPane problem with more than one Excel application open

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

AdxExcelTaskPane problem with more than one Excel application open
 
Daniel Wosch


Guest


Hello,
i have a problem with the AdxExcelTaskPane if i have more than one Excel application open.

Lets suggest we have two Excel applications running ExApp1 and ExApp2

1. Starting ExApp1
2. AdxExcelTaskPane not visible on the left side (this is correct)
3. Clicking an button in the Add-in Express Add-in Ribbon in ExApp1
4. AdxExcelTaskPane opens / shows up on the left side in ExApp1
5. Starting ExApp2
6. AdxExcelTaskPane is already visible with not initialized labels (this is not correct)
7. Clicking an button in the Add-in Express Add-in Ribbon in ExApp2
8. AdxExcelTaskPane opens / shows up on the left side in ExApp1 but it should show up in ExApp2

Seems like im controlling my add-in in ExApp1 from ExApp2

What im doing wrong?

Following you'll find some code snippets:


 public Excel._Application ExcelAppInstance
        {
            get
            {
                return (HostApplication as Excel._Application);
            }
        }

 private void openTrendDetectionModule(TrendDetectionTaskPane.TrendDetectionModules selectedModule)
        {
                TrendDetectionTaskPane taskPane = this.alandaTaskPanesCollection.TaskPaneInstances[0] as TrendDetectionTaskPane;
                Microsoft.Office.Interop.Excel.Range selectedRange = this.ExcelAppInstance.Selection as Microsoft.Office.Interop.Excel.Range;

                this.LetTaskPaneShow = true;

                if (taskPane != null)
                {
                    taskPane.Visible = true;
                    if (!taskPane.Active)
                    {
                        taskPane.Activate();
                    }
                    taskPane.Show(selectedModule, selectedRange, TrendDetectionTaskPane.TrendDetectionModuleShowMode.ShowAndSetDestination);
                }
            }


Let me know if you need some further information.

With kind regards.
Daniel
Posted 05 Jan, 2016 07:43:58 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Daniel,

I have 2 quick questions:
- What Excel version do you use?
- What do you mean by "two Excel applications"? Do you mean 2 separate Excel processes (you can check this in Task Manager) or two open Excel workbooks?
Posted 05 Jan, 2016 10:07:27 Top
Daniel Wosch


Guest


Good Morning Dimitry,
to answer your questions:

- It occurred in 2013 - In 2010 and 2007 i can not reproduce this behavior.
- In this case i mean two separate Excel processes.

Please let me know if you need further information.

Greeds
Daniel
Posted 06 Jan, 2016 03:48:49 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Daniel,

Thank you. I cannot run two separate Excel 2013 processes, I always have just one excel.exe process in Task Manager. Could you please tell me how you do this?

Also, is it possible for you to send me your project (or some demo project with the same behavior) for testing?
Posted 06 Jan, 2016 04:46:15 Top
Daniel Wosch


Guest


Hey Dimitry,
i do this by clicking on the Excel Icon in taskbar using the middle mouse button.
This way i have to excel instance running and two excel tasks in the taskbar open.

You know what i mean?

Greeds
Daniel
Posted 06 Jan, 2016 04:51:59 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Daniel,

The middle mouse button did not help, I still have just one excel.exe process. Though I can see another excel process in the Task Manager for a small fraction of time, it appears and immediately disappears.
Posted 06 Jan, 2016 05:37:44 Top
Daniel Wosch


Guest


Hello Dimitry,
i'll provide you with an screenshot during the day to show you what i mean.
Maybe it will make it more clear.

Greeds
Daniel
Posted 06 Jan, 2016 05:41:06 Top
Daniel Wosch


Guest


Hello Dimitry,
following you'll find the promised screenshots:

http://imgur.com/fqoGZRs
http://imgur.com/IdMlp1T
http://imgur.com/SamQ0W0

Greeds
Daniel
Posted 06 Jan, 2016 07:18:39 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Daniel,

Thank you, I see the same on my machine.

In your code, I have noticed that you always get access to the first instance of your task pane:
TrendDetectionTaskPane taskPane = this.alandaTaskPanesCollection.TaskPaneInstances[0] as TrendDetectionTaskPane;


I would suggest that you use the TaskPaneInstance property of the ADXExcelTaskPanesCollectionItem class:

TrendDetectionTaskPane taskPane = this.alandaTaskPanesCollection.TaskPaneInstance as TrendDetectionTaskPane;


This will solve point #8. To solve point #6 I need to have a look at your code.
Posted 06 Jan, 2016 11:36:00 Top
Daniel Wosch


Guest


Dmitry Kostochko writes:
To solve point #6 I need to have a look at your code.


What exactly you want to see from the code?
Posted 07 Jan, 2016 01:50:31 Top