I developed an Excel VSTO add-in in Visual Studio 2010. It works fine on different combinations of Windows 7+ and Excel 2007+, but fails to load on Windows XP and Excel 2007 with a non-informative "A runtime error occurred during the loading of the COM Add-In" message. VSTO_SUPPRESSDISPLAYALERTS=0
and VSTO_LOGALERTS=1
produce no data.
After debugging with API Monitor and Dependency Walker, I found the following. In order to load the add-in, Excel loads C:\Program Files\Common Files\Microsoft Shared\VSTO\10.0\VSTOLoader.dll
. This library imports GetFileVersionInfoEx
function from C:\Windows\System32\Version.dll
, which is available only starting with Vista. So loading of my add-in DLL is not even attempted, since the process fails very early during loading of VSTO Runtime.
Any ideas on how to fix this? Am I missing some dependency? Here is what I have installed so far:
- .NET 2.0 SP2
- .NET 3.5 SP1
- .NET 4.0
- Office SP3
- VSTO 2010 Runtime from http://www.microsoft.com/en-us/download/details.aspx?id=48217
- PIAs from http://www.microsoft.com/en-us/download/details.aspx?id=18346