Excel Task Panes - setting TaskPaneClassName

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

Excel Task Panes - setting TaskPaneClassName
Manager returns ERROR H_RESULT E_FAIL returned from a COM component 
Tom Mulholland




Posts: 15
Joined: 2012-06-26
Hi

I had task pane manager with 10 items all correctly linked to existing task pane files etc. I was hoping to copy controls from an existing windows form to a new task pane and then delete the existing form.

So, in design-time I dragged three controls from the existing form to the new pane. I copied the form's code to the pane's code area at the bottom after the initialise event, commenting it out to prevent problems. I then deleted the form.

Now I cannot assign a taskpaneclassname to any existing taskpanecollectionitems, nor can I create a new collection item. This error message will not go away.

I have checked the filename links and have no errors or warnings.

Any ideas - thanks for your help!
Posted 26 Apr, 2021 01:59:56 Top
Andrei Smolin


Add-in Express team


Posts: 18007
Joined: 2006-05-11
Hello Tom,

Make sure the old task pane files are actually deleted and try to restart Visual Studio.

Andrei Smolin
Add-in Express Team Leader
Posted 26 Apr, 2021 02:10:07 Top
Tom Mulholland




Posts: 15
Joined: 2012-06-26
Thanks Andrei

I have checked: each remaining pane in my project has 3 files you would expect, with .vb, .resx and .Designer extensions. The deleted files were successfully deleted from the project folder.

Restarting VS has no effect, and I have checked creating a new fresh project works ok with no error message when I add task pane to manager.

The only thing I can think of is, when I dragged controls from an older windows form to a new task pane (design areas), did this cause the GUIDs of each to get confused or not be consistent with each other?

I'm hoping there's an obvious answer, I don't really want to have to delete my task panes manager then recreate it all again particularly if there is no reason why it happened in the first place.

Hoping you can help !

TM
Posted 26 Apr, 2021 07:06:05 Top
Andrei Smolin


Add-in Express team


Posts: 18007
Joined: 2006-05-11
Hello Tom,

When specifying the pane class, you have to specify both namespace and class name e.g.the TaskPaneClassName property would be "MyAddin24.ADXExcelTaskPane1". I assume the class name hasn't changed after copying it but the namespace has changed because this is a different project with a different Root Namespace! So if I copy these 3 files to another project, say MyAddin25, the namespace would be different and the TaskPaneClassName would need to hold "MyAddin24.ADXExcelTaskPane1"!

To All,

This is about VB.NET, not C#.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 26 Apr, 2021 09:57:49 Top
Tom Mulholland




Posts: 15
Joined: 2012-06-26
Hi Andrei

That would make sense, but the form was already sitting in the same namespace as the pane (both have been existing in the same project).
I only have one project. I haven't copied the form class, I have just dragged controls from the form to the pane class.
I then deleted the form class from the project.

No matter, I am going to have to see when my last functioning backup was and try again......
Posted 26 Apr, 2021 11:42:09 Top