Quantcast
Channel: NetOffice - MS Office in .NET
Viewing all articles
Browse latest Browse all 1741

New Post: Error occur when create CustomTaskPane

$
0
0
I create an excel addin.
[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.0

But when call CreateCTP an exception Unable to create activeX object.


How to add Custom Task Pane ??

Viewing all articles
Browse latest Browse all 1741

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>