I create an excel addin.
But when call CreateCTP an exception Unable to create activeX object.
How to add Custom Task Pane ??
[ComVisible(true)]
[COMAddin("Test", "Test Excel插件", 3), RegistryLocation(RegistrySaveLocation.CurrentUser)]
[GuidAttribute("9C1865C9-8E2F-43C4-8594-97599D4E8012"), ProgId("Test.ExcelAddin")]
public class MyAddin : NetOffice.ExcelApi.Tools.COMAddin
{
public MyAddin()
{
}
public override void CTPFactoryAvailable(object CTPFactoryInst)
{
try
{
TaskPaneFactory = new ICTPFactory(this.Application, CTPFactoryInst);
_CustomTaskPane target = this.TaskPaneFactory.CreateCTP(typeof(MyUserControl).FullName, "Test");
Console.WriteLine(target);
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
}
}
And MyUserControl.cs is[ComVisible(true)]
public partial class MyUserControl : UserControl
{
I use NetOffice 1.7.3.0But when call CreateCTP an exception Unable to create activeX object.
How to add Custom Task Pane ??