1

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... enter image description here


This problem is caused by the Settings configured in the project
enter image description here

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?

Valip
  • 4,440
  • 19
  • 79
  • 150
  • one small observation - all other addins have simple paths starting with c:\ only your addin has a file:// url so it could be that it is not trusted! – Digvijay May 02 '17 at 07:53
  • I'm sure that it should work even if it's not trusted – Valip May 02 '17 at 07:57
  • No. That is how VSTO works @Digvijay – Patrick Hofman May 02 '17 at 07:57
  • 1
    @PatrickHofman - Thanks - i have not worked much with VSTO however with straight COM addins and thats why it looked odd. However Valip have you looked at http://stackoverflow.com/questions/4668777/how-to-troubleshoot-a-vsto-addin-that-does-not-load – Digvijay May 02 '17 at 08:01
  • Yes, it looks odd, but it works @Digvijay – Patrick Hofman May 02 '17 at 08:02
  • I think the file path should end with `|vstolocal` too, but I might be wrong. – Patrick Hofman May 02 '17 at 08:03
  • If it helps, I published the Add-In by following this tutorial: https://www.youtube.com/watch?v=t4BTLdIMYEY – Valip May 02 '17 at 08:23
  • @PatrickHofman I've found the problem, can you please check the updated question? Thank you! – Valip May 02 '17 at 11:05
  • 1
    In Visual Studio, use `Debug > Attach to Process...` right before you click that button. Then you can find out yourself. – Chris May 05 '17 at 21:09
  • Uninstall your app from Control Panel -> Programs -> Uninstall a program. Then open up Excel, choose "Blank workbook", go to File -> Options -> Add-ins -> COM Add-ins -> Choose "Go..." -> Select "MyAddIn" -> Choose Remove -> Click OK. Close Excel. Install your add-in. Open up Excel again. Now it should work. – Michael Sep 12 '19 at 12:00

0 Answers0