Troubleshooting

link - learn.microsoft.com/en-us/microsoft-365/troubleshoot/group-policy/office-add-in-not-loaded 

Message - The file format and extension of 'myAddin.xll' don't match

The file format and extension of 'myAddin.xll' don't match 
The file could be corrupted or unsafe.
Unless you trust its source, don't open it. Do you want to open it anyway?

When you try and load an "xll" file automatically you see this prompt.
Make sure the folder path of this add-in is included in the System, Path, environment variable.


Message - The System cannot find the file specified

The system cannot find the file specified 
System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HResultL 0x80070002)
at System.Deployment.Internal.Isolation.IsolationInterop.GetUserStore(UInt32 Flags, IntPtr hToken, Guid& riid)
at System.Deployment.Internal.Isolation.IsolationInterop.GetUserStore()

Check there is an APPDATA environment variable.
Open a "cmd" prompt and type "set".
Check there is an APPDATA entry.


Message - Exception reading manifest from file

Exception reading manifest from 
file:///C:/Program Files (x86)/ .. / AppName.vsto
the manifest may not be valid or the file could not be opened

The version of the .NET Framework that is installed on the machine does not meet the minimum requirements for the add-in.
Check the target framework for the add-in, Properties, Application tab.


Message - The name 'Globals' does not exist

The name 'Globals' does not exist in the current context.  

Check that all the namespaces are consistent and correct.
Make sure that files in subfolders have the correct namespace.


Message - ThisRibbonCollection does not contain a definition for GetRibbon

ThisRibbonCollection' does not contain a definition for 'GetRibbon' and no extension method 'GetRibbon'  
accepting a first argument of type 'ThisRibbonCollection' could be found.

Check that all the namespaces are consistent and correct.
Make sure that files in subfolders have the correct namespace.


Message - A runtime error occurred during the loading

Not Loaded. A runtime error occurred during the loading of the COM Add-in 

Check the registry entry:
HKEY_CURRENT_USER\Software\Microsoft\Office\Excel\Addins\


Message - Could not load file or assembly

Could not load file or assembly 'XmlSerializers' or one of its dependencies.  
The system cannot find the file specified.

Check excel.exe.config and remove/rename it.


Message - The common language runtime could not be loaded

The common language runtime could not be loaded by 
file:///C:/Program Files (x86)/ .. /AppName.vsto|vstolocal.
Contact your administrator for further assistance.

Check the correct version of the Visual Studio Tools for Office Runtime is installed
Check excel.exe.config
This can occur when you perform an "in place" office upgrade from a previous version and the add-ins from the older version are still installed.
This is often a result of the add-in trying to load an older version of the .NET Framework.
Check and Install the required version of the .NET Framework.
Check the value of the PreferredClr in the following registry key.
HKEY_CURRENT_USER\Software\Microsoft\VSTO\SolutionMetadata


Message - ButtonClick Exception

An exception occurred while calling function 'ButtonClick'.  
Could not load type 'Solution.Project' from assembly

Check the assembly modified dates and that the assembly contains this class


Message - Downloading file .vsto did not succeed

Downloading file:///C:/Program Files (x86)/ .. / AppName.vsto did not succeed 
Could not find a part of the path

The file cannot be found, make sure the installation folder exists.


Message - The customization cannot be installed

The customization cannot be installed because another version is currently installed and cannot be upgraded 
from this location.

This is normally seen on development machines and indicate that there is more than one registry entry for this application.
Remember that building a project results in registry keys being added automatically.
If you also have the application installed then this would create a duplicates.


Message - Unable to install this application because an application is already installed

Unable to install this application because an application with the same identity is already installed. 
To install this application, either modify the manifest version for this application
or uninstall the preexisting application.

There are two ways to clear the ClickOnce Application Cache mage -cc or rundll32 dfshim CleanOnlineAppCache


Message - Customization does not have the permissions required

Customization does not have the permissions required to create an application domain 

The location of the add-in (or document-level solution) is not in the Office Trusted Locations list or all trusted locations are disabled.
It is always better to work on your C drive.


Message - Ambiguity between method "" and non-method

Ambiguity between method 'Microsoft.Office.Interop.Word._Document.Close(ref object, ref object, ref object)' 
and non-method 'Microsoft.Office.Interop.Word.DocumentEvents2_Events.Close'. Using method group.
Ambiguity between method 'Microsoft.Office.Interop.Excel._Worksheet.Activate()'
and non-method 'Microsoft.Office.Interop.Excel.DocEvents_Events.Activate'. Using method group.

Change the document data type to Word._Document instead of Word.Document or cast the document to Word._Document ((Word._Document)myDocument)


Message - Managed Add-in Loader failed to initialize

Not Loaded. The Managed Add-in Loader failed to initialize. 

Check the correct version of the Visual Studio Tools for Office Runtime is installed.


Message - Method not found "get_COMAddIns"

Method not found "Microsoft.Office.Core.ComAddins" Microsoft.Office.Interop.Word - Application.getCOMAddIns() 

Reinstall Office 2007.


Message - Unrecognised configuration section UserSettings

Configuration system failed to initialise. 

Delete the user.config file from the following location.
C:\Documents and Settings\"----"\local settings\Application Data\Microsoft_Corporation\AppName.dll.manifest_\


Message - Unable to find a version of the runtime to run this application

Unable to find a version of the runtime to run this application 

Check that .NET framework is installed correctly.


Message - The add-in could not be installed

Application manifest has either a different computed hash than the one specified or no hash specified at all. 

You need to regenerate the application manifest. Delete all files from the Debug/Release folders.


Message - MyAddin.dll has a different computed hash

MyAddin.dll has a different computed hash than specified in the manifest. 

You need to regenerate the application manifest. Delete all files from the Debug/Release folders.


Message - Customization could not be loaded

Customization could not be loaded because the application domain could not be created. 

Reinstall .NET Framework 3.5.
Reinstall VSTO Runtime 9.0.32.


Message - An Application with the same identity is already installed

An Application with the same identity is already installed 

.NET ClickOnce applications get deployed into a subfolder of C:\Documents and Settings\\Local Settings\Apps\2.0
You need to clear the ClickOnce cache.
cd C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\ Mage.exe -cc


Message - Add-in could not be found or loaded

Could not load file or assembly "Microsoft.Office.Interop.Word Version=11.0.0.0" or one of its dependencies. 

The system cannot find the file specified.
Change your install of Office to not include Smart Tag .NET Programmability Support.
Remove the VSTOSmartTags entry from the ThisAddin.Designer.xml file.
and then comment out the four references to this.VSTOSmartTags in ThisAddIn.Designer.cs.


Message - Value does not fall within the expected range

Value does not fall within the expected range 

Remove any special characters (& in the network install path) from Manufacturer Property.


Message - The expected element "addin" was not found in the XML

The expected element "addin" was not found in the XML 

If you add-in was created in Visual Studio 2010 targetting .NET 4.0 and running in Office 2007 then you must have the 2010 VSTO runtime installed on that PC.
If you were using Office 2010 this is not a problem.


Message - Cannot access a disposed object

Cannot access a disposed object 

This is a known bug in Visual Studio 2008 SP1.
Install VSTO Runtime v3 SP1.
Customize office installation - remove Smart Tag .NET programmability support.
Remove the line "ThisAddInDesigner.xml".


Message - MyAddIn is not a valid Office Addin

MyAddIn is not a valid Office Addin 

Check the security permissions using caspol.exe
Your setup project will need to use the SetSecurity project.


Message - Cannot find the interop type

Cannot find the interop type that matches the embedded interop type 'Microsoft.Office.Interop.Excel.Workbook'. 
Are you missing an assembly reference?

The corresponding PIA is not installed on this machine


© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext