Equivalent for TaskPaneInstance in plain excel VSTO addin

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

Equivalent for TaskPaneInstance in plain excel VSTO addin
 
Sagi


Guest


Hi
We have an issue in our addin where in a very specific case where taskPane.Window is null where taskPane is retrieved by _taskPanesCollectionItem.TaskPaneInstances.
In order to understand if the issue is in ADX or Office, we are trying to reproduce this issue without ADX, for that, but we are not sure what ADX is doing to get the taskPane behind the scene.
Should we create a https://docs.microsoft.com/en-us/visualstudio/vsto/how-to-add-a-custom-task-pane-to-an-application?view=vs-2019 and add it?
Posted 06 Nov, 2020 07:17:45 Top
Andrei Smolin


Add-in Express team


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

I assume you talk about the WindowObj property. That property return null. If this is so, wait for a while and repeat the attempt.

Custom Task Panes are a different sort of panes and you may not be able to reproduce this issue.


Andrei Smolin
Add-in Express Team Leader
Posted 06 Nov, 2020 07:42:01 Top
Sagi


Guest


Thank you for the prompt response. Can you please share more about the issue? is this a known issue?
We try to access the object as part of an operation completed callback, retrying later sounds like something we'd like to avoid.
Posted 06 Nov, 2020 07:54:17 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Sagi,

Calling WindowObj causes Add-in Express to find a specific window and try to get an AccessibleObject using the window's handle. If Add-in Express gets an AccessibleObject, WindowObj returns a non-null value. But you can't guarantee that such an AccessibleObject would exist in *any* context. Say, you'll get null if you issue the call when the window is already created while the object isn't created yet. Or, if the task pane still exists but the window is already destroyed.


Andrei Smolin
Add-in Express Team Leader
Posted 06 Nov, 2020 09:32:04 Top