Office add-in development: troubleshooting tips
Add-in Express™ 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 registrationIf 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 loadingMake 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-inOn 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 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-inThis 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-inWhen 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 registeredSymptoms. 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 userSymptoms.
Suggestions. See Bypassing the AlwaysInstallElevated policy. Add-in is inactiveThis occurs if the user turns off the add-in or if the add-in generates an unhandled exception at startup. Symptoms.
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 userThis 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 administratorThis 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 disabledOffice can disable the add-in if it crashes the Office program. Symptoms.
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-inThis 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 invalidThe 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 blockedAn XLL add-in doesn't load because the user/administrator has blocked certain file types from being loaded in Excel. Symptoms.
Suggestions. Uncheck the item above, modify the registry, or contact the administrator. Per-machine add-in loads only for administratorThis 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 loadedPossible reasons are:
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.
Office 2002-2003:
Excel 2007, Word 2007, PowerPoint 2007:
Outlook 2007:
Office 2010-2013:
|