다음을 통해 공유


My Office Addin does not Load!

“I installed my Office solution (VSTO add-in) successfully but when I open the Office application, my add-in does not load. What is the problem?”

This is a common question which I came across many times in Forums. Here are simple and quick checks that you can do before you start scratching your head or jump to the Forums. I’ll be using Excel as the Office application, but the approach is applicable to others more or less.

1. Make sure your add-in is installed correctly and it is enabled

Open registry editor and navigate to “HKEY_CURRENT_USER\Software\Microsoft\Office\Excel\Addins”. Here is how this registry key looks like after I installed MyExcelAddin:

The registry string we are interested in the most is the LoadBehavior. Whenever you see "3" (Loaded at Startup) as the value of this string you are good in this part and your add-in tries to load when the Excel starts. For more information about registry entries for application-level Office solutions see this article.

2. Check out “COM Add-Ins” dialog in Excel

Now open Excel and see if your add-in loads successfully. If not, open Excel Options dialog (File->Options) and navigate to Add-Ins tab.

 

“Healthy add-ins” show up as “Active Application Add-ins”, however, if an add-in is disabled for whatever reason, it will appear under the “Inactive Application Add-ins”. You can select the “COM Add-ins” from the Manage dropdown at the bottom of this dialog and see the LoadBehavior of all COM add-ins. In normal cases, the add-in should be checked and its "Load Behavior" should be “Loaded at Startup”:

If the VSTO runtime encounters a problem loading the add-in, you’ll see this message instead.

“Load Behavior: Not Loaded. A runtime error occurred during the loading of the COM Add-in” .

3. Find the problem

Set the "VSTO_SUPPRESSDISPLAYALERTS" environment variable to 0. Then go back to the registry key I mentioned in step 1 and set the LoadBehavior to 3. Now restart the Excel. You should be able to see a dialog describing what is happening:

It is also a good practice to enclose the code inside the add-in's startup event in a try-catch block and log all exceptions.

 

4. Hard disabled add-ins

If an add-in causes the Office application to crash (close unexpectedly), the add-in gets “hard disabled”. Please follow this instruction to re-enable the add-in. In addition, you might want to check the “HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Resiliency\DisabledItems” (replace 12.0 with 11.0 for Office 2003 and with 14.0 for Office 2010). Your add-in should not have an entry under this registry key.

More References:

--

Good day to you!

Hamed

Comments

  • Anonymous
    June 28, 2010
    The comment has been removed
  • Anonymous
    June 28, 2010
    Hi Varun, Let me clear some points first:
  1. I am assuming your VSTO solution targets .NET 4.0 client.
  2. are you using MSI or ClickOnce? if MSI, have you verified that all required registry keys are created? look here: msdn.microsoft.com/.../bb386106.aspx
  3. What Office 2010 and VS2010 you are using? Beta? or RTM? can you give me the build numbers?
  4. Have you wrapped the entire code in the addin startup within a try-catch block? any exception?
  5. When you say "it works fine on the Dev platform", are you debugging on the dev machine or you really installed the addin? (please note that you need to do a "clean solution" on the VSTO project in VS before installing the addin on your dev machine and uninstall the addin if you want to go back to debugging!). also what are differences between your dev machine and target one? different OS, VS, Office? (even build numbers or the order you installed these).
  6. do you have ANY other addin on the PC target that works?
  7. do you have any other machine (preferably similar to the dev machine) that you can install the addin? Hamed
  1. Yes, solution targets .Net 4.0 Client Profile
  2. Using MSI Installer for deploy. And all mentioned Registry entries exists.
  3. Version Info:     VS 2010 Ultimate - 10.0.30319.1 RTMRel     Outlook 2010 - 32-bit - 14.0.4760.1000
  4. Yes, I've wrapped the code in  try/catch but not working. Also, you should know that the project was originally in VS 2005 for outlook 2007, and have been upgraded to VS 2010 recently.
  5. On Dev machine it works fine in debugging way, I've not tried installing it on Dev machine.
  6. No I don't have any other addins on the PC
  7. Yes, the OS and Office application are same on my Dev machine and a test machine. WIndows 7 - x64 and Office 2010 - x86. I'll update the result of the troubleshooter tomorrow. and Thanks for looking into this ...
  1. I've taken the precautions and have migrated as mentioned in the blog.
  2. Yes, I created a new VS 2010 project with just hello world. It also does not work. Add-In was disabled. Hamed, can you tell me the role of .manifest file?
  • Anonymous
    June 28, 2010
    Also, here is my info in registry: Description: My Addin to do some testing FriendlyName: My Addin For Outlook LoadBehavior: 3 Manifest: [TargetDir]MyAddin.dll.manifest

  • Anonymous
    June 29, 2010
    Here is some information on the manifest: msdn.microsoft.com/.../a3swb498(VS.80).aspx Since you are not able to load/run any addin, I would say the machine is not in a good state. because the VSTO_SUPPRESSDISPLAYALERTS does not show any issue, it looks like we do not even get to the VSTOLoader and everything fails before that (for instance loading CLR).

  1. Since this is Win 7, you should have .NET 3.5 installed. I would suggest creating a 3.5 solution and test that as well, just to make sure it is not the .NET version specific issue.
  2. from the screenshot, I see that you have both Office 2010 and 2007 installed. any reason for that? in what order you installed them? look here for more information on having Office versions side by side: support.microsoft.com/.../928091
  3. if it is easy for you to reimage the machine, I would suggest that. just install things in this order: .NET 4.0, Office 2010. troubleshotting a machine in a bad state might take longer than reimaging the machine.
  • Anonymous
    June 30, 2010
    Hamed, Though I got the addin to work on 32-bit, I would still like to answer your questions ...
  1. I got the toolbar loading properly in Outlook 32-bit, it was a Manifest key value error, I had used .manifest in that for office 2007 solution but I had to us .vsto|vstolocal for this to work in 2010.
  2. No, i do not have 2 versions of Office installed. It is fresh installed test machine. Only had WIndows 7 - x64 and Office 2010 - x86 on it. Also, if possible can you guide me why would this addin of mine gets installed properly for 64-bit version of office and the Addin has all the same Registry values in Wow6432 node under HKLM/Software key. But Outlook does not detect it. It does not show in Add-Ins Tab of Outlook Options. Do I've to create a new project to target 64-bit version of office? In my existing project I have platform = "Any CPU", I thought it should work if registry entries are under 64-bit Registry nodes .. isn't it ? Thanks.
  • Anonymous
    July 01, 2010
    Glad that your addin finally loaded. Sorry about the Office 2007 comment, I misread the screenshot. the value in front of Office 2007 is 0, i.e. you did not have Office 2007. the "vstolocal" is required for msi deployment because it tells Office to load the manifest from a local installation folder not the ClickOnce cache. this is described in this document (msdn.microsoft.com/.../bb386106.aspx) which has been pointed out before in our discussion. I believe the "vstolocal" is required for both Office 2007 and 2010 solutions because ClickOnce is available for both of these Office versions. Also here is another forum thread talking about it: (social.msdn.microsoft.com/.../514d6278-d7df-47c1-9e11-08a5a4c43ca4). The bitness of Office does not matter. Registry keys always go the registry hive that matches the OS bitness. your registry keys shold go under Software/Microsoft/Office/[AppName], not under the 32 bit hive on a 64 bit machine (i.e. Wow6432). That is why your addin does not show up. If you target "Any CPU" you should be able to install the msi on both 32 bit and 64 bit machines.

  • Anonymous
    August 19, 2010
    Trying to post this again; didn't seem to work. Apologies if this is just some delayed posting mechanism with no notification of that process.

I'm currently trying to get a new clean Excel Add-In to open in Excel and am hitting this same LoadBehavior changing from 3 to 2 problem. The difference here is that if I set the value for LoadBehavior to 3, and run Excel outside Visual Studio, my Addin loads fine and  runs fine. The add-in code itself is quite mature and robust; I've just migrated it from VSTO2005 to VSTO2005SE because Microsoft pulled the availablility (or so it seems) to VSTO2005 and either way this problem happens with a clean new Excel Add-In so this it not a problem with any code I have written. The part where LoadBehavior keeps changing to 2 is when I try to run the solution from Visual Studio. When I do that, Excel starts and nothing else happens. When I check Add-Ins my Add-In is listed as enabled, it is not prohibited; it just doesn'tload or run (no break points anywhere are hit.) VSTO_SUPPRESSDISPLAYALERTS = 0 does nothing useful (actually it does nothing). The only thing that does happen is that registry key value changes from 3 to 2. If I manually edit it to 3 again I can run Excel outside Visual Studio again and my add-in works fine. This is purely a Visual Studio problem and what's more with the default Visual Studio project settings for an Excell Add-In. Seeing the purpose of upgrading this Add-In to VSTO 2005 SE was to be a code sample for our users the fact it won't run from the development environment is a deal breaker. This is actually the intended use case in this instance; to allow users to learn about developing against our object model.
I've got a lot of experience with VSTO 2003 and VSTO2005, but not much with VSTO2005SE, but it appears that the trend of being extremely hard to use and configure (and debug) continues with VSTO. I do like the Add-In approach, but a new clean Add-In failing to run feels like a class A fail, IMHO. :-)
By the way I'm running VS2005, and Excel 2003 Professional on my dev machine; companies with massive code bases cannot be as nimble as others who upgrade to the latest version the second it is released, so hopefully someone might know a little bit about why this may be happening?
Thanks in advance.
  
* **Anonymous**  
August 20, 2010  
I did some more testing on my issue and found that when I start Excel as per normal (my OS is Win7 32-bit, virtual machine) my Add-In loads and runs just fine. If, however, I start Excel as an Administrator it does not load and changes the LoadBehavior registry key to 2. Now why did I try running as an administrator? Well, since I am running VS2005 on Win7, it has "issues" running on that OS and the recommendation by Microsoft, I believe, is to run VS2005 as an administrator. It's annoying to do, but until my company upgrades to VS2008 (which I use a bit at home) or VS2010 I'm stuck running VS as administrator. I tested this by NOT running VS as an admin and it works, I can hit break points and everything. I take back what I said about ease of use for VSTO2005SE; it's just my luck to hit this stuff I guess.
OK, so I've found the root cause of my problem, but my question is why running as an admin would prevent the Add-In from loading? Surely running as an Admin should be better than running as a regular user should it not? Or is this some secuirity enforcement to not running add-ins with admin rights? If that is the case I can accept it and perhaps even understand it, but if possible I'd like to confirm it so I can pass that information on to my users. Thanks.
  
* **Anonymous**  
February 01, 2011  
The comment has been removed  
* **Anonymous**  
February 05, 2011  
Hi Andrei,
Thanks for sharing your solution :)
Hamed
  
* **Anonymous**  
February 13, 2011  
Hi Hamed.I read all the previous information carefully, but no one trouble relates to me. The problem in that i cannot load the WBS Modeler add-in for Visio 2007. It isn't shown in Visio 2007 menu after installation.
I checked the registry key and found out that everything is ok with installation, even Loadbehavior value is set to 3. But not in list of COM Add-ins in Visio 2007 nor in menu, WBS modeler is shown. 
Help me this way please, cuz its connected with my job and i cannot do the things right without this add-in.
  
* **Anonymous**  
February 14, 2011  
Hi AlexAnB,
a few questions:
1. what SKU of Visio are you using? Professional?
2. Is it enabled when you look at the COM-Addins in Visio?
Hamed
  
* **Anonymous**  
March 31, 2011  
Big help with the VSTO_SUPPRESSDISPLAYALERTS environment variable.  That saved my bacon.  Thanks.
  
* **Anonymous**  
March 31, 2011  
The comment has been removed  
* **Anonymous**  
April 01, 2011  
Brent, Hong,
I'm glad that you found the content useful :)
Hamed
  
* **Anonymous**  
April 14, 2011  
Hi Hamed,
Thanks for such a helpfull blog
I have the same problem with my Excel Add-in.
Specifications are : 
1) Excel Add-in for 2007 using VSTO
2) .NET Framework 3.5
The problem is that , in Excel 2010 the add-in works fine but in some systems Add-in is not loaded in Excel 2007.
The LoadBehavior shows : Unloaded in the Options-> Addins-> COM Addins.
  
* **Anonymous**  
May 01, 2011  
Hi Priyanka,
have you followed the steps I described? did you fin anything useful? any exception or error that setting the "VSTO_SUPPRESSDISPLAYALERTS" revelas? what are all the machines you have identical as far as OS, .NET, and Office? what is it different on those machines that the addin does not load on?
Hamed
  
* **Anonymous**  
July 13, 2011  
Thank you. Posts like these are gold. 
(Rant: A RESILIENCY key? Really?!...gawd)
  
* **Anonymous**  
August 19, 2011  
Hello, I have a problem connected with Office 2007 and VSTO add-in.
Description:
Windows XP SP3 x86
MS Office 2007 x86 (Enterprise edition)
My VSTO add-in is not shown in the menu.
HKEY_CURRENT_USERSoftwareMicrosoftOfficeExcelAddinsMyAddin
LoadBehavior = 3
In Add-Ins tab (File->Options) I can see that my add-in is active. There are no any exceptions.
I can reproduce this issue in the following order:
1)install MS Office;
2)install add-in
  - .net framework 2.0 is installed;
  - add-in is installed.
But if .net framework had already been installed before I installed the Office -- add-in works in the right way.
1)install .net framework 2.0;
2)install MS Office
3)install add-in
 ----> add-in works properly...
On Windows 7 x86 (Office 2010 x86) add-in works. Maybe because Windows 7 already contains .net framework.
I can't resolve this issue... Maybe you will be able...
Thank you in advance!
  
* **Anonymous**  
August 24, 2011  
This really helped me to get back my MPP addin, its all the same technique everywhere !  Thanks for your blog.
  
* **Anonymous**  
August 26, 2011  
The comment has been removed  
* **Anonymous**  
June 07, 2012  
I had the same problem After a week of troubleshooting I realized that the Microsoft Visual Studio 2010 Tools for Office Runtime (x86 and x64) was unchecked in pre-requisites. I checked it and the problem was solved.
  
* **Anonymous**  
June 21, 2013  
Hi Hamed,
I am having a similar problem. The addin loads on few machines but not on few. On the machine where it did not load i tried using the VSTO_SUPPRESSDISPLAYALERTS variable and got an exception when the excel loads but am not able to decipher what it means. Could you help me out?
The error states - "Customization could not be loaded because the application domain could not be created."
  
* **Anonymous**  
July 18, 2013  
I am facing registry issue while deploying MSI of Outlook Add-in on various machines :-
Though I have added the registry entry (in setup project) pointing to the office manifest (vsto file) into the Office registry hive, all user having different configuration of OS and Office facing the issue.
All Possible combinations are :-
32 bit(x86) Office on 32 bit (x86) OS            
HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice Outlook Addis[add-in ID]
32-bit(x86) Office on 64-bit(x64) OS             HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftOffice Outlook Addis[add-in ID]
64-bit(x64) Office on 64-bit(x64) OS             
HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice Outlook Addis[add-in ID]
64 bit(x64) Office on 32 bit (x86) OS             
It is not possible to install a 64-bit version of Office on a 32-bit version of Windows
For single user :-
HKEY_CURRENT_USERSoftwareMicrosoftOffice OutlookAddis[add-in ID]
What should be the generic solution to take care all machine configuration ? As my setup not working on all machine.
  
* **Anonymous**  
July 18, 2013  
I did proper registry setting now.
But still my Outlook addin not loaded showing in inactive list and showing error "Not loaded. A runtime error occurred during the loading of the COM addin."
After this error Loadbehavior entry set to 2.
The same MSI working properly on all machines but not on few machines (OS win7, 32 bit and having 32 bit Outlook14).
Please help me out.
You can contact me at pkalne@cybage.com or kalneprasad@gmail.com.
Thanks.
  
* **Anonymous**  
August 14, 2013  
my problem is a bit different. my add in in word loads ok. but to see it in the ribbon i have to minimize the ts session and maximizit back. this happens when the protected view is disabled in the options. any ideas where to look.
  
* **Anonymous**  
January 12, 2014  
Does an MS stuff actually ever work? AddIn gets randomly disabled; auto update doesn't work (you have to manually uninstall/re-install it). 40 years of consumer computing and your stuff is still shoddy, unreliable. 
  
* **Anonymous**  
June 05, 2014  
Guys,,,
what si the solution you found for this issue?
Could you please anybody can paste it here??????
Thank you
  
* **Anonymous**  
June 22, 2014  
Guys... 
My Outlook add-in takes 30sec to load , And outlook 2013 disables all the add-in which takes longer to load..
I Have set the load behavior to 3 but outlook changes it to 2.
Each time i have to manually load the addin.
Any solution for this.....
  
* **Anonymous**  
July 17, 2014  
Just to let you all know, the hard disabled tip was the solution to my Excel add-in tab not showing in Excel.
  
* **Anonymous**  
July 23, 2014  
Hi Hammed,
I gone through all of your comments and that is really quite helpful but did not solve my issue.
I have Office add in build on VS 2005 that works with office 2003/2007 and 2010 but recently after 2013 launch I tried the same with Office 2013 and somehow my add in's are not loaded. They are in in-active state. Can you please let me know what could be the issue and how can i make it work for office 2013.
Regards,
Deepak
  
* **Anonymous**  
October 05, 2014  
Hi Hamed,
Your post came up first in my google search and registry change to 3 worked like a charm.
Thanks.
  
* **Anonymous**  
December 04, 2014  
hi Hamed
I deployed a Word add in for office 2013 using vs 2010 . the issue the addin loading is ok. but addin is not working properly its work fine in word 2010. is there any modification to do for ms word 2013 deployment
Thanks in advance
  
* **Anonymous**  
December 14, 2014  
For all who are getting &quot;Not loaded. A runtime error occurred during loading of COM add-in&quot; error, this KB article is very helpful: <a href="http://support.microsoft.com/kb/976477/">support.microsoft.com/.../976477</a> . I was having this problem for one of my Outlook Addin when tested on Outlook 2007. After installing SP3 for Outlook, the Addin is now functioning properly. This link may also be useful : <a href="http://mattdeacon.wordpress.com/2011/11/22/not-loaded-a-runtime-error-occurred-during-loading-of-com-add-in/">mattdeacon.wordpress.com/.../not-loaded-a-runtime-error-occurred-during-loading-of-com-add-in</a> . Thank you.
  
* **Anonymous**  
December 15, 2014  
Deepak, Santhosh
I came across same issues as yours. have you found any solutions?? 
  
* **Anonymous**  
February 25, 2015  
I am using a Excel addin where in it is not loading when there some orphan excel are running the background and the user tries to open the excel directly from the browser. Any help would be appreciated.
  
* **Anonymous**  
February 25, 2015  
I am facing the same issue with my excel addin where it is not getting loaded when there are some excel applications running in the background and the user is opening the excel directly from the browser. I have added VSTO_SUPPRESSDISPLAYALERTS in the environment variables but I am not getting any error.
  
* **Anonymous**  
February 28, 2015  
Even i have similar issue with my VSTO Add-in. The add-in loads only for new file but not for existing files. What may be the reason for this kind of behavior? 
After restarting the machine, issue gets resolved. But after some time, again add-in wont load for existing files.
Settings:
1. Technology: Visual studio 2010, C#4.0, MS Excel 2010
2. Registry: HKEY_CURRENT_USERSoftwareMicrosoftOffice ExcelAddins[add-in ID]
3. Load at startup
Troubleshooting:
1. Have enabled VSTO_SUPPRESSDISPLAYALERTS, but dint work.
2. Options-&gt;Manage COM Add-in -&gt; Add-in is checked.(load at start up)
Kindly help me out.
  
* **Anonymous**  
March 06, 2015  
Hope someone can help. I am manually entering COM addin in to the registry but I need the, add-in id. where can I find this?
  
* **Anonymous**  
July 19, 2015  
Thank you !!
I try it according to your describe, it works!
you help me solve a big problem, thanks again!
  
* **Anonymous**  
December 01, 2015  
hi Hamed 
thank you for useful blog.
I have a trouble with &quot;Panian7&quot; add-in in onenote.
this add-in is for &quot;hijri&quot; calander.
the wonderful subject is : this add-in work so well in word but is inactive in onenote.
also I set load behavior =3 for HKEY_CURRENT_USERSoftwareMicrosoftOfficeonenoteAddinsparnian.connect 
but this couldn&#39;t solve problem.
please help me.
thank so.
  
* **Anonymous**  
January 28, 2016  
Hi Hamed
Thank you !!
I am stuck in one issue my add in is working fine in word 2007 - 2010 but when I am using the same in word 2013 alignment is not coming properly . What could be the issue any idea I have done lot googling and from code side there seems to be no issue.
please help
thanks!! :)
  
* **Anonymous**  
January 28, 2016  
I follow all the instruction but no luck, but my situation is bit different.
I developed Outlook 2010 AddIns using VS 2013 Ultimate and It always can run on dev machine in debug mode as well when doing MSI installation. But now problem is when I install at client side even it didn&#39;t show in disabled Add Ins list, there is no error during installation. Client Environment is totally different, they are using Win 7 64 bit on virtual machine. Important thing is even it didn&#39;t throw any error during installation but I cannot find installed add ins in registry under Office/Outlook/AddIns, try to search to find any entry to check load behavior but no luck so I kind of lost. &nbsp;Any suggestion...looking very much for a help