NetOffice CustomTaskPane is being disabled on load

0

I'm trying to replace VSTO with NetOffice for an Excel Addin. I'm able to load the taskpane, but it is disabled and I'm unable to interact with any of the controls on it. I can get the example taskpane to work fine, but mine will not even thought the code is pretty much the same. Both are UserControls with standard elements. The only thing I can see that may be causing an issue is in the Output on build, there are Excel.EXE errors, but I cannot trap those, nor can I find anything on the internet to point me in the right direction as to what they might be. So here's the code that I use to add the taskpane:

TaskPanes.Add(typeof(MainTaskPane), "Main Task Pane");
TaskPanes[0].DockPosition = MsoCTPDockPosition.msoCTPDockPositionRight;
TaskPanes[0].DockPositionRestrict = MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoHorizontal;
TaskPanes[0].Width = 250;
TaskPanes[0].Visible = true;
TaskPanes[0].Arguments = new object[] { this };

Pretty much straight out of the samples.

The Excel error I get is:

First-chance exception at 0x75cdc42d in EXCEL.EXE: 0xC004F012: 0xc004f012.

Any help pointing me in the right direction would be awesome and help me level up in this battle of the code.

c#
excel
netoffice
asked on Stack Overflow May 30, 2014 by Erick

1 Answer

0

I finally figured out the the Events in the taskpane needed to be attached in the constructor. Once that was done everything worked just fine.

answered on Stack Overflow Jun 2, 2014 by Erick

User contributions licensed under CC BY-SA 3.0