LoadBehavior for MS Word 2007 add-in being set to 2 - com

I have an add-in for MS Word. One of my users, who is on Word 2007, reports that the add-in is not being loaded. When she checks the COM add-ins list, it says "Load Behavior" is "Unloaded; Load at Startup" (value of 2 in LoadBehavior registry entry).
Yet when she checks the add-in's registry entry, LoadBehavior is set to 3 (Loaded; Load at Startup). The add-in is also not loaded at all.
Is there some reason for the discrepancy between what Word is reporting for the add-in, and what's in the registry, and is there a way to resolve it?
I have a hunch that Word has set a LoadBehavior value somewhere else on her system after the add-in crashed, but she is remote from me, and doesn't want me to remote control her computer to check myself.
Edit: Some additional info: if the user runs a macro to check my add-in in Application.COMAddins, Connect is set to False. However, updating this to True doesn't seem to have any effect. The property will stay True as long as Word is running, but if Word is restarted then it will revert to False (and the add-in is never loaded).
More information: The add-in had been disabled due to a crash, and put in the disabled add-ins list. The user enabled the add-in from the COM add-ins drop-down list, but the load behavior was then stuck on 2, despite the registry value being 3. WinWord.exe doesn't have any compatibility settings.
Also, I provide three add-ins: one for Word, one for Excel, and one for PowerPoint. The Excel and PowerPoint add-ins work fine on the user's computer. I test the add-in myself on XP, Vista, and 7 (32 and 64 bit). The user is on Vista 32 bit.
The Word add-in was working on the user's computer for about two years, but after a crash it was disabled, and the LoadBehavior was stuck on 2. The user actually tried uninstalling and reinstalling Office, but that didn't change the behavior.
Solution
0xA3's solution wasn't complete, but on the right track. It turns out that the user had installed a new antivirus program, which was disabling the add-in (silently! ::insert rant about overzealous AV::).
I also learned a valuable lesson: to some users, "Have you installed any new software" doesn't include antivirus programs. I'll have to change that question to, "Have you installed any new software, or any antivirus programs?"

As said by Otaku, the problem seems to be that the add-in cannot be loaded and therefore is disconnected. It might due be an incomplete/corrupt installation of the add-in, a missing dependency or incorrect/missing registration of a COM component.
It's hard to give you more concrete tips, but here is a list of trouble-shooting tools that you might want to use during Word startup:
DebugView from Sysinternals, run as Administrator, with Capture Global and Capture Kernel enabled.
fuslogvw.exe to check for missing assemblies (assuming your add-in is written in .NET)
DependencyWalker to see for missing native dlls
Process Monitor to check for missing files/registry entries
Is there some reason for the discrepancy between what Word is reporting for the add-in, and what's in the registry, and is there a way to resolve it?
The reason for the discrepancy between the Registry and the actual Word setting is most likely that the current add-in state (loaded, but disconnected) is not stored in the Registry at all because the user has no sufficient permissions to change the HKLM Registry key. The LoadBehavior remains 3 in the Registry, and on next Word startup Word will try again to load and connect the add-in.

Addins can be registered in the USER hive or the LOCAL MACHINE hive, same folder in each.
HKEY_CURRENT_USER\Software\Microsoft\Office\Word\Addins\Your addin name
or
HKEY_LOCAL_MACHINE\Software\Microsoft\Office\Word\Addins\Your addin name
be sure to check both.

FYI : I was having similar issue with Excel AddIn. Excel "blacklisted" the add-in due to an error (which has not necessarily generated any error message). Go to: AddIns > "Disabled items" > Enable Addin resovled the issue for me.

Related

Excel COM add-in for Training The Street no longer loads after another add-in is uninstalled, reinstalling does not work

My TTS Turbo Macro Excel COM add-in was working before I uninstalled Logi Options Plus for the second time.
I tried cleaning up related registry items and reinstalling TTS Turbo Macro add-in and Logi Options Plus but it didn’t help. The load behavior value of 3 for TTS add-in was correct; load count also matches the number of times I launched MS Excel, though the add-in never loaded. To further troubleshoot, I added paths related to TTS add-in to trusted location, but to no avail. I had ran into the similar situations where TTS add-in does not load; reinstalling the OS would fix it but I’d rather not waste that much time on it again. The TTS add-in also has an Excel (non-COM) add-in. When I launch Excel, I could see it’s been loaded, but nothing appears on the ribbon like before. Is there anything else I can do to troubleshoot and fix the issue?
By default, if a VSTO Add-in attempts to manipulate the Microsoft Office user interface (UI) and fails, no error message is displayed. However, you can configure Microsoft Office applications to display messages for errors that relate to the UI. You can use these messages to help determine why a custom ribbon does not appear, or why a ribbon appears but no controls appear. See To show VSTO Add-in user interface errors for more information.
Also Microsoft Office applications can disable VSTO add-ins that behave unexpectedly. If an application does not load your VSTO add-in, the application might have hard disabled or soft disabled your VSTO Add-in.
Hard disabling can occur when a VSTO add-in causes the application to close unexpectedly. It might also occur on your development computer if you stop the debugger while the Startup event handler in your VSTO add-in is executing.
Soft disabling can occur when a VSTO add-in produces an error that does not cause the application to unexpectedly close. For example, an application might soft disable a VSTO Add-in if it throws an unhandled exception while the Startup event handler is executing. Read more about that in the How to: Re-enable a VSTO Add-in that has been disabled article.
But I'd suggest contacting add-in developers instead.

Slow and Disabled Add-ins for Outlook

I have created an add-in for outlook but I cannot get it installed on one person's computer.
Here is the message she gets:
I am posting this on stack as opposed to another site because we are the developers so it might be a development issue.
Here is what I have tried to get rid of this message:
exiting outlook.
uninstalling plugin from control panel.
rebooting computer.
starting outlook and observing that the add-in is gone.
install the add-in using the setup.exe that is generated by visual-studio
observe that add-in is not active and that the error message above is displayed.
This add-on works on several other people's machines.
What is different for this person is that she was the first to have it installed so she had a version that did have a startup issue that I would expect this error.
I suspect that somehow outlook is "remembering" the add-in rather than the add-in is still failing.
Two questions:
What can I do to get it installed?
What can I do to detect this in the add-in so I can report it automatically?
Set your addin's key to 1 in
HKCU\Software\Policies\Microsoft\Office\16.0\Outlook\Resiliency\AddinList
and
HKCU\Software\Microsoft\Office\16.0\Outlook\Resiliency\DoNotDisableAddinList
and delete it from
HKCU\Software\Microsoft\Office\16.0\Outlook\Resiliency\DisabledItems
"16" in the keys above refers to the Outlook version (16 for 2016, 15 for 2013, etc.)

VB.Net Word Add-in has automatically installed itself

I am developing an add-in for Word to add ribbon bar functions for our business.
I am developing the add-in in VB.Net using Windows Visual Studio 2017.
The machine is currently a stand-alone machine that is not connected to the main network.
My issue is that for some reason, the add-in seems to have set itself up in such a way that it appears to have already been installed on the system and loads, with the most updated code, if I just start Word normally.
Any development has been done in Debug mode and I have not been re-building the solution in release mode, and yet anything I change and then run/debug updates the code that the add-in appears to be run off when opening Word directly.
If I go through the options --> add-ins and disable the VTSO add-in it just gets enabled again. I don't seem to be able to separate a debug/development section and live code.
Edit from comments: I can accept that the VTSO needs to be installed and registered but having no separation of live code and development code is frustrating. This machine is used by others for other purposes and this includes using Word, and so any old code must be kept as comments that can set back as the working code should I need to leave part way through. I cannot leave anything partially written as any run the debug mode will set the code as live.
What you're experiencing is normal behavior. When you debug, VSTO registers the add-in in the Windows Registry. This is all that's required for the Office application to find and load the add-in when it starts.
If you disable the add-in in Word, it will remain disabled until you again debug the add-in in Visual Studio.
If you share the machine and want to have the add-in under development disabled for other users:
Work with separate user profiles. VSTO registers its add-ins under CurrentUser, not for all users - VSTO isn't designed to register add-ins for the entire machine. OR
Get into the habit of using Visual Studio's Build/Clean Solution functionality when you leave the machine. That unregisters the add-in (until it runs in debug mode again).

VSTO Addin for Outlook won't work

I've seen tons of posts and sites that address this issue. I've tried every solution I've found but none of them work (I've been trying to figure this out for days now). I have seen many posts with the same exact sounding issue, but either the solution didn't work for me or isn't applicable. With that said...
I have an add-in for Outlook 2007 that is intended to add text to the an email's title and body. It is installed for all users using an .msi file. There is an older version that I deployed last year that works fine. The new version I created has only a few minor input/output changes, nothing major. This new version works perfectly on my development computer in both debug from Visual Studio and from an actual install. However, I can't get it to work on a non-development computer. Here are the details on the program and target computer (development computer and target computer details are the same other than the fact that the target computer doesn't have Visual Studio):
-Using Visual Studio Professional 2013
-Written in Visual Basic
-Target Framework is .NET 4.0
-The add-in is only run once the "send" button on an email is clicked.
-Outlook version is Outlook 2007
-Operating system is Windows 7 Enterprise SP1 32-bit
The problem is that the add-in won't load on the target computer(yes, I know, a bazillion other people have had the same issue). As I said previously, it works fine on my computer in both debug and installed versions. This made me think that the other computer is missing something, so I tried installing the .NET 4.0 framework onto the target computer but it told me that it was already installed. I ran through everything I could think of to get it to work with no avail. Here's how it behaves:
-Installs fine with no errors.
-HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Office/Outlook/Addins/EmailMarkTool/LoadBehavior = 3 after installation.
-VSTO_LOGALERTS = 1
-VSTO_SUPPRESSDISPLAYALERTS = 0
-Outlook opens with no apparent errors.
-LoadBehavior = 0 immediately after Outlook is opened.
-Shows up in the Add-ins under "Inactive Application Add-ins."
-Never shows up under "Disabled Add-ins."
-In the "COM Add-Ins" dialog where I can check which add-ins to use, it shows the correct directory and the Load Behavior is "Unloaded."
-The add-in can be checked. When I click "OK" I don't get any errors. When I go back to the Add-ins, it is unchecked and "Unloaded" again.
-Setting the LoadBehavior to 3 doesn't help because it goes back to 0 as soon as Outlook is started again.
-I inserted a try-catch block into the New() function of the add-in that has a MsgBox pop-up and a Throw.
-I get absolutely no errors anywhere.
-No log file is generated.
I have tried uninstalling, rebuilding, and reinstalling multiple times all with the same result. I just can't figure out why it will work on my development computer but not the target computer. Thanks for reading all of this. I know it's a lot, but I needed to get the details out. Thanks in advance for any input!
[UPDATE]: I just created a brand new minimal add-in just to test if it would work but got the same results.
I found the problem!
The problem may be unique to Outlook 2007. It turns out Microsoft Office 2007 SP1 and SP2 had a bug that prevented it from running VSTO addins. Microsoft released a hotfix that fixes this issue (https://support.microsoft.com/en-us/kb/976477). This was added in to the release of Microsoft Office SP3. However, to activate the fix, a new registry flag must be created but that isn't automatically done with the fix, making the fix useless until you manually activate it (instructions and download here). So...
To enable VSTO addins in Outlook 2007, you have to add a subkey to this registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Common\General\
and add a DWORD "EnableLocalMachineVSTO" with the value set to 1.
I did this, restarted the computer for good measure, installed my addin for the 23rd time, and it installed and ran perfectly! I'm not sure how previous versions worked, though. It's possible that our system admins removed that subkey in an effort to bolster security at some point.
The loadbehaviour key problem you are experiencing is strange. Whilst I think this is probably not your solution, it could be, so its worth a try.
The target computer will need to have VSTO tools for office runtime installed.
You can download these tools are the following link - https://www.microsoft.com/en-GB/download/details.aspx?id=48217

Add-Ins cannot load into Office 2007

I deploy a VSTO 4 file like picture below
It work well in a lot of Computers but some computers my AddIn cannot show. I have checked on the check box in the second picture, but when I restart Word Program and open the dialog "Com Add-Ins" a gain the check box is not checked. My AddIn is not shown.
I have build my AddIn in Visual Studio 2010, output VSTO 4. I deploy into Win XP and Word 2007, .net 4 is installed at the computers.
Please tell me what is the problem, how to fix it.
I encountered this problem as you in one system with excel addin, when the user opened her excel file, the addin was not exist, in this case when I opened excel from start menu and clicking on office button and opening file from there the addin appeared
it is temporary solution, after while when she re-installed the office the problem solved.
Most probably you get an unhandled exception in the code of the add-in.
when I restart Word Program and open the dialog "Com Add-Ins" a gain the check box is not checked. My AddIn is not shown.
Microsoft Office applications can disable add-ins that behave unexpectedly. If an application does not load your add-in, the application might have hard disabled or soft disabled your add-in.
Hard disabling can occur when an add-in causes the application to close unexpectedly. It might also occur on your development computer if you stop the debugger while the Startup event handler in your add-in is executing.
Soft disabling can occur when an add-in produces an error that does not cause the application to unexpectedly close. For example, an application might soft disable an add-in if it throws an unhandled exception while the Startup event handler is executing.
When you re-enable a soft-disabled add-in, the application immediately attempts to load the add-in. If the problem that initially caused the application to soft disable the add-in has not been fixed, the application will soft disable the add-in again.
Read more about that in the How to: Re-enable an Add-in That Has Been Disabled article.
Also you can check out the Trust center setting in the host application.