Office add-in development: troubleshooting tips

Add-in Express™
for Microsoft® Office and .net

Add-in Express Home > Add-in Express for Office and .NET > Online Guide > Tips and notes > Troubleshooting tips

On this page you will find a handful of troubleshooting tips that address the most frequent issues that Office add-in developers are faced with:

Troubleshooting add-in registration

If the registration log file is not created/rewritten when you run the installer, check Get details about add-in registration/unregistration for the location and file name of the registration log file and make sure that the permissions of the user starting the installer allows creating file in that location.

If the file doesn't contain any warnings or errors, this means the add-in has been registered successfully.

If running the installer produces an adxloader.log containing warnings or errors, contact us to find the cause(s) and solution(s).Typical are these issues:

Troubleshooting add-in loading

Make sure that the generateLogFile attribute is set to true in the add-in manifest, see Add-in Express Loader Manifest. By default, the log file - the default file name is adxloader.log - is generated in the folder {Documents}\Add-in Express in the profile of the user who starts the host application, see Get details about add-in loading. If the manifest contains the logFileLocation attribute, make sure that the user starting the host application is permitted to create files in the folder specified in this attribute.

Start the host application and check if an adxloader.log file is created/rewritten in the default location or in the location specified by the logFileLocation tag (see above). If starting the host application produces an adxloader.log containing warnings or errors, contact us to find the cause(s) and solution(s).

If the file doesn't contain any warnings or errors, this means the add-in has been loaded successfully. The record The managed add-in class has been created successfully means the constructor of the module was called and no error has occurred.

If adxloader.log isn't created, the variants are these:

One more issue is described here. Below is a citation:

"Add-in was still partially registered for "all users" in HKLM hive of registry, and this was blocking the "per user" registration from working correctly"

Finally, there was a case of Excel started using the account other than the current user's account; supposedly, this was due a security setting. The most intriguing was the fact that per-user COM add-ins were loaded correctly while XLL add-ins do not load.

Insufficient privileges when registering a per-machine add-in

On Windows XP, this occurs if a standard user runs the installer of a per-machine add-in. On UAC-equipped systems, this occurs if the installer of a per-machine add-in is run with non-elevated privileges; typically, this occurs if the user starts the .MSI, not setup.exe.

Symptoms. The header of the adxregistrator.log file contains these lines:

Command Line: {...omitted...} /privileges=admin
Run 'As Administrator': No
Process Elevated: No

Suggestions. Run the installer with administrative permissions. On UAC-equipped systems, you can bypass the situation above by running setup.exe, not the .MSI. For surety, you can start setup.exe using the "Run as administrator" command.

BadImageFormatException when registering the add-in

This exception occurs when a 32bit process loads a 64bit assembly and also when a 64bit process loads a 32bit assembly. In the context of registering an Add-in Express add-in this occurs if you build your assembly for the x64 platform; the point is the adxregistrator.exe executable (see How your Office extension is registered) is 32 bit.

Suggestion. Build your add-in for the Any CPU platform.

Exception when registering the add-in

When your add-in is registered or unregistered, Add-in Express creates an instance of the add-in module. Because in this situation the add-in isn't loaded in the host application, you can't use any Office-related classes. If the code isn't prepared for this, it will break. If it breaks when you uninstall the add-in, you'll have to clean the registry either manually or using a registry cleaner program.

The same applies to class-level initializers; they are executed even before the module constructor is run.

To initialize your add-in, you need to use the AddinInitialize event of the module. It fires when Office loads the add-in. Note, however, that for Ribbon-enabled Office applications, the first event that the module fires is OnRibbonBeforeCreate.

Add-in is not registered

Symptoms.

All Office versions. The add-in registry keys are missing in the locations given in Locating COM Add-ins in the Registry.

Suggestions. Check if the adxregistrator.log file (see Get details about add-in registration/unregistration) contains any information about the problems.

Per-User add-in is registered for System user

Symptoms.

  • All Office versions. The adxloader.log file (see Get details about add-in loading) is missing. The adxregistrator.log file (see Get details about add-in registration/unregistration) contains the following line:

Process Owner: System

Suggestions. See Bypassing the AlwaysInstallElevated policy.

Add-in is inactive

This occurs if the user turns off the add-in or if the add-in generates an unhandled exception at startup.

Symptoms.

  • Office 2007-2013: The add-in is listed under the Inactive Application Add-ins category and the add-in is not checked in the COM Add-ins dialog.
  • All Office versions: The add-in is not checked in the COM Add-ins dialog.

Suggestions. Enable the add-in in the COM Add-ins dialog. If this creates/rewrites an adxloader.log, then follow the instructions in Troubleshooting add-in loading. Otherwise, see Add-in is not registered.

All Application add-ins are disabled by user

This occurs if the user has chosen to disable all application add-ins.

Symptoms.

Office 2007-2013: The add-in is listed under the Active Application Add-ins category; the add-in is checked/ticked in the COM Add-ins dialog; clicking the add-in in the dialog displays the message "The add-in you have selected is disabled by your system administrator."

Suggestions. Uncheck/clear the Disable all application add-ins checkbox.

All application add-ins are disabled by administrator

This occurs if the administrator has chosen to disable all application add-ins.

Symptoms.

Office 2013: No add-ins are listed under the Active Application Add-ins category; the add-in is not checked/ticked in the COM Add-ins dialog you cannot set it; clicking the add-in in the dialog displays the message "Not loaded. The user selected to disable macros".

Suggestions. See http://support.microsoft.com/kb/2733070 for details. Contact system administrator.

Add-in is disabled

Office can disable the add-in if it crashes the Office program.

Symptoms.

  • Office 2007-2013: the add-in is listed under the Disabled Application Add-ins category.
  • Office 2007-2013: the add-in is listed under the Disabled Application Add-ins category.
  • Office 2002-2013: the add-in is listed in the Disabled Items dialog.

Suggestions. Open the Disabled Items dialog and enable the add-in. Look for the cause of the issue; debug the add-in.

Administrator cannot load a per-user add-in

This applies to Vista and all subsequent Windows versions. This doesn't apply to Windows 2000 and Windows XP.

Symptoms.

On Vista with no service packs installed, Windows ignores per-user COM objects if the process is created by a member of the local Administrators group and UAC is disabled. This is by design.

On Vista SP1 and all subsequent versions, Windows ignores per-user COM objects if UAC is enabled and the process is elevated. This is by design.

Suggestions. On Vista, enable UAC. On Vista SP1 and later, run the host application non-elevated. For instance, you may need to look for the "Run as administrator" checkbox in the shortcut starting the application.

Digital signature is missing or invalid

The user requires all application add-ins to be signed and the add-in is not signed or the certificate is invalid/outdated

Symptoms.

Suggestions. Obtain a valid certificate (see Introduction to Code Signing) or clear the checkbox.

XLL add-in is blocked

An XLL add-in doesn't load because the user/administrator has blocked certain file types from being loaded in Excel.

Symptoms.

  • Office 2010-2013: the Excel Add-in Files item is checked/ticked on the File | Options | Trust Center | trust Center Settings | File Block Settings page
  • Office 2003-2013: see registry entries at http://support.microsoft.com/kb/922848.

Suggestions. Uncheck the item above, modify the registry, or contact the administrator.

Per-machine add-in loads only for administrator

This occurs if an add-in is installed to a location that other users don't have permissions for. Typically, this occurs if the default installation folder for a per-machine add-in is set to [AppDataFolder] or [LocalAppDataFolder], rather than [ProgramFilesFolder].

Symptoms.

The add-in loads correctly for the administrator who installed it. Other users don't see the add-in.

Suggestions. Install the add-in to a location accessible by all users on the machine.

An assembly required by your add-in cannot be loaded

Possible reasons are:

  • the assembly is missing in the installer
  • the user starting the host application doesn't have permissions for the folder where the add-in was installed; say, a per-machine add-in is installed to a user's Application Data folder and another user loads the add-in
  • PublicKeyToken of your add-in assembly doesn't correspond to the PublicKeyToken mentioned in the Add-in Express loader manifest. See below.

You can find the PublicKeyToken of your add-in in the setup project, which must be already built. Click on your add-in primary output in the setup project and, in the Properties window, expand the KeyOutput property and see the PublicKeyToken property value.

  1. There's no such list in Office 2000

Office 2002-2003:

  1. Go to the main menu -> Help -> About -> click Disabled Items

Excel 2007, Word 2007, PowerPoint 2007:

  1. Click the Microsoft Office Button
  2. Go to {application name} Options->Add-ins
  3. Select Disabled Items from the Manage drop-down list at the bottom of the window and click Go.

Outlook 2007:

  1. Go to the Outlook menu -> Tools -> Trust Center -> Add-ins
  2. Select Disabled Items from the Manage drop-down list at the bottom of the window and click Go.

Office 2010-2013:

  1. Click File -> Options -> Add-ins
  2. Select Disabled Items from the Manage drop-down list at the bottom of the window and click Go.