12

I had previously installed the VS11 beta, and had some issues with my Visual Studio 2010 instance, which you can see here how they were resolved: Excel AddIn Click Once deployment issue.

Now I have a code base which compiles/builds a vsto, which installs fine and runs fine in Excel 2010. However, when I remove the installed version from Excel, and try to run it directly through Visual Studio 2010, the AddIn does not get loaded into Excel when running in debug configuration mode, in release configuration mode it works fine. Any ideas on why this might be occurring? I've tried re-enabling it through Com AddIns, and a few other things with no luck.

Community
  • 1
  • 1
mservidio
  • 12,817
  • 9
  • 58
  • 84

6 Answers6

20

I've found the issue which was not letting me run my project in 'Debug' configuration mode, though it worked in 'Release' mode. At some point, the AddIn, got hard-disabled (not sure if that's the term to use). At that point, trying to re-enable from within Excel doesn't do anything. Within the registry, there is a folder where disabled AddIns are flagged. I deleted all of the keys from this folder except for "(Default)" and now my AddIn works when launching from Visual Studio 2010 in 'Debug' mode.

HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Excel\Resiliency\DisabledItems

enter image description here

mservidio
  • 12,817
  • 9
  • 58
  • 84
  • This also works for Word, the problem I get is typically by exiting the running program during debugging. But is there a way to to this other than the registry? – ForEachLoop Aug 14 '14 at 17:26
1

When you run through Visual Studio 2010 does it hits the breakpoint in the addin_startup event. If not try to debug this way

Hope this helps you

Kiru
  • 3,489
  • 1
  • 25
  • 46
  • It does not hit the breakpoint for startup event. Additionally, it doesn't even install the AddIn I just noticed... so the debugging on that link doesn't create a log file. – mservidio Apr 23 '12 at 20:32
  • 1
    Are you running you VS as administrator? – Kiru Apr 23 '12 at 20:35
  • Yes, something strange is going on. I just only changed my configuration setting from 'Debug' to 'Release', and when I run it, it hits the start-up event. So it works in 'Release' configuration mode, but not 'Debug' – mservidio Apr 23 '12 at 20:37
  • I see your registry entries are pointing to the binaries in the release folder. You can find registry entry for your addin here HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Word\AddIns or HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Word\AddIns – Kiru Apr 23 '12 at 20:39
  • I removed the AddIn from excel through the Com Add-Ins form.That deleted the key at Computer\HKEY_CURRENT_USER\Software\Microsoft\Office\Excel\Addins\MyAddIn, and when I run in debug, it just doesn't install it or hit the start-up event. When I run in release mode it works fine though. Maybe there's another registry key? – mservidio Apr 23 '12 at 20:44
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/10412/discussion-between-kiru-and-mservidio) – Kiru Apr 23 '12 at 20:51
  • I never found a reason for why this project only worked in release mode. I copied all of my code into a new project, and it works now. Something got corrupted in my old project. I took a diff of the files and couldn't find what caused the issue though. – mservidio Apr 23 '12 at 21:46
  • 2
    Could you also check if the addin has been disabled? Go to File => Options => Add-Ins => Choose Disabled Items in the Manage dropdown and click GO – Kiru Apr 24 '12 at 08:29
  • I had checked that each time I tried running debug mode, after each clean build. Something in the project was corrupted it seems after dealing with the previous VS11 created issue. – mservidio Apr 24 '12 at 13:51
  • this issue just came up again in my new project. I was coding, and debugging, and everything was working well. Then I went to run in debug again, and it wouldn't open the addin in excel, it wouldn't hit the startup event. So then I changed to 'Release' configuration mode, and it works. I can't figure out what this issue is. – mservidio May 02 '12 at 19:58
1

You can reenable a hard-disabled Add-In with Excel

http://msdn.microsoft.com/en-us/library/ms268871(v=vs.80).aspx

Dirk Brockhaus
  • 4,922
  • 3
  • 38
  • 47
1

I had the same problem in Excel.

The following worked for me:

Go to the following key....

HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Excel\AddInLoadTimes

see if your plug-in is listed. if so, delete it.

now run your app from Visual studio again.

This worked for me, hope it can help someone else.

GeoSaffer
  • 143
  • 12
0

I had the same problem with a Word VSTO, but there was no Resiliency\DisabledItems folder in my registry, so I think it was never hard disabled (as in @mservidio's solution). What worked for me was to edit the Manifest path in HKEY_USERS\<user key>\Software\Microsoft\Office\Word\Addins\<Add-In name> to reflect the 'Debug' path rather than the 'Release' path.

To find the right folder it might be easiest just searching for the Add-In name and checking that any Manifest keys refer to the Debug path.

enter image description here

rudivonstaden
  • 7,675
  • 5
  • 26
  • 41
0

I also had the same problem, what I didn't understand was :

Why I re-install Office 2016, I don't change my code neither VS setting but I get a cant load error message ?

After many many hours, repairing Office and VS and getting the same error message, I observed that the Addin was starting well in Release config, I started checking the difference between the both config in my code. I found that debug config was targeting to x86 proc bug release to any cpu

So Office x64 didn't load x86 dlls (in my case)

Fabrice T
  • 648
  • 9
  • 23