Excel Add-In not working after publish

纵然是瞬间 提交于 2020-01-15 09:54:51

问题


I've created an Excel COM Add-In in C# using Visual Studio 2013 Professional which displays a CustomTaskPane as a right sidebar in Excel.

This is working perfect when running it directly from the IDE, but not working when installing it from the setup file generated when I published the solution.

The Add-In MyAddIn appears in the Add-Ins list, but it stays Inactive at all times when I try to activate it by pressing the Go... button at the bottom and then mark the add-in to activate it.

Any solution would help me a lot...


This problem is caused by the Settings configured in the project

This is how is use them:

public UserControlSDR()
{
    InitializeComponent();
    string settingAdbKey = Properties.Settings.Default.adbeKey;
    string settingAdbUser = Properties.Settings.Default.adbeUser;
    string settingOpKey = Properties.Settings.Default.opKey;

    textBoxAdbKey.Text = settingAdbKey.Substring(settingAdbKey.LastIndexOf(":") + 2);
    textBoxAdbUser.Text = settingAdbUser.Substring(settingAdbUser.LastIndexOf("Text: ") + 6);
    textBoxOpKey.Text = settingOpKey.Substring(settingOpKey.LastIndexOf(":") + 1);
}

If I remove the code below InitializeComponent() everything works fine ... why?

来源:https://stackoverflow.com/questions/43732766/excel-add-in-not-working-after-publish

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!