Unable to load the Excel 2003 Add-in - c#

I'm trying to develop an Excel 2003 Add-in using Visual Studio 2008 (SP1).I didn't add any code expect for the boilerplate code added by Visual Studio.
When I run the application in VS it loads up Excel, but the add-in itself does not work. The "COM Add-Ins" window list the add-in, but it's unchecked. The "Load Behavior" reads as "Not loaded.A runtime error occurred during the loading of the COM Add-in".
VS was unable to catch the exception at load-time even though I've enabled all options under Debug > Exceptions.
I also tried setting up VSTO_SUPPRESSDISPLAYALERTS Environmental variable as mentioned in this MSDN article.Surprisingly that also didn't show me any messages.
I'm running Office 2003 (SP3) under Windows XP.It'll be great if someone can help me.
Thanks.

You'll have to install KB908002. Please see
.NET app.config question
How to select .NET framework version running from Excel?
The installation with VS 2008 is a little more complicated. See here:
Can a .NET Word 2003 add-in be installed outside of the GAC?

Related

How to debug Visio add-in that will not load in Windows 10

I have an add-in for Visio 2007, which works well on Windows 7, but the same add-in does not load when run on Windows 10. In Visio's Trust Center, the add-in shows up as "inactive" on Windows 10. The add-in gets into the registry, but LoadBehavior changes from 3 to 2 as soon as Visio starts. I understand this to mean there was a runtime error when Visio tried to load the add-in.
This add-in is written in C#, Visual Studio 2012. VSTO 2010 is installed (required for automatic Trust Center acceptance). Maybe if I could find out what the runtime error is, I could make progress. How can I find more information about this runtime error? Breakpoints are not hit, anywhere in the add-in code, including InternalStartup(). It seems to fail before running the add-in code. I set up Fusion logging, but did not find messages related to Visio or the add-in, and I am not sure this is even a relevant tool for this problem. I also have set system environment variables VSTO_LOGALERTS = 1 and VSTO_SUPPRESSDISPLAYALERTS = 0 but I do not see any alerts or logs.
Another developer is able to run this add-in on Windows 10 from Visual Studio 2012, but we cannot determine what the difference is on that machine versus mine. Several other Windows 10 machines are unable to run this add-in, since it always is inactive (LoadBehavior = 2). The goal is to deploy this add-in on Windows 10, just like it is already deployed on Windows 7.
I found AddInSpy to be helpful, but it did not point directly to the problem.
https://github.com/NetOfficeFw/AddInSpy
It showed me an error message from my Add-in:
“Add-in DLL path is not found”
but this is not the actual problem. (The path to the add-in is valid.) There is a different problem that caused the add-in to not load, which caused this somewhat misleading message in AddInSpy.
AddInSpy also showed the VSTOR version in use = 2008. Searching VSTOR, I found many versions work with .NET 3.5. My Windows 10 machine did not have .NET 3.5 installed. After installing .NET 3.5, the add-in worked!
To summarize: AddInSpy helped (indirectly) find that the add-in was not loading because .NET 3.5 was not installed on my Windows 10 machine.

Excel Addin does not compile properly on different machines

I have a very old Visual Studio Excel AddIn project.
When I compile it on my machine on VS2013 (.Net 4.0) and Office 2010 it works perfectly on the other machines. But when I compile it on TFS machine (no Office, only the vsto_redist.exe) it does not work - it does not load.
I've tried to switch on the VSTO_LOGALERTS and VSTO_SUPPRESSDISPLAYALERTS but this did not show any errors.
I've also tried to add a Microsoft.Office.Interop.Excel.dll to the project it still does not worked.
Any help on how I can see the problem will be helpful.
You need to install at lest the Excel developer tools that cinder in the box with office.

InfoPath cannot start Microsoft Visual Studio Tools for Application

when i hit alt+shift+F12 in InfoPath (which should open VSTA), i get the following error:
Obviously no helpful information (thanks Microsoft.
I have installed MSXML and .NET 2.0 as according to: source
If your computer does have the Microsoft .NET Framework 2.0 and Microsoft Core XML Services 6.0 installed before installing Microsoft Office InfoPath 2007, InfoPath uses the Microsoft Visual Studio Tools for Applications (VSTA)
i double-checked the installations aswell: Source
.NET 2.0 in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP
and when i run msxml6.msi the wizard instantly shows:
i tried several reinstalls of all those features:
(sorry for the screenshot beeing in german but i rly didn't get the installation wizard to change it's language, i tried everything.)
interestingly i can start vsta.exe standalone. But InfoPath cannot create a C# Project for VSTA.
now has anyone a good idea how i can get either better error information (i tried event viewer allready, didn't find anything useful) or solve the problem?
thanks in advance! phil
Turns out that it depends on your Version of Visual Studio installed.
i uninstalled MS Visual Studio Express for Web and installed VS Professional. It's perfectly working now. At least Microsoft could specify this somewhere -.-

C# VSTO Project change from Excel 2010 to Excel 2007

I have a solution in VS2010 that was developed as an Excel 2007 add-in. Unfortunately something happened with my profile and since then VS runs the solution with Excel 2010. Somehow my profile got corrupted and my VS solution got corrupted too changing the Office library from 2007 to 2010. I tried changing the library back to 2007 but every time I open the VS solution VS changes it. Anyone has an idea how to fix this problem?
You must have installed Office 2010 which forces VS.NET to use the Office 14 PIAs. You can still deploy your add-in to Office 2007, you just have to be sure you don't use any Office 2010 specific features.
Also see related SO post .

Outlook Addin Error: Not loaded. A runtime error occurred during loading of COM add-in

I have created an VSTO Outlook addin. The configuration is as follows:
Visual Studio 2008
Office 2007 Outlook add in (3.5 Framework)
MSI created using Visual Studio Setup Project
Deployed to Office 2010 under windows 7
It works fine on the Dev PC however it fails to load once installed on the test machine. The outlook addin window shows a "Not loaded. A runtime error occurred during loading of COM add-in"
It is my understanding that I should not need to install any PIA as the Office 2007 PIA are part of Office 2010.
So far I have tried the following:
set VSTO_SUPPRESSDISPLAYALERTS however it does not show any messages when it tries to start.
configured Fuslogvw.exe (Assembly Binding Log Viewer) however it is not showing any binding errors.
set VTSO_LOGALERTS and it is logging all alerts however as none are shown this has not helped.
Is there anything I am doing wrong or need to do in addition to make this work?
Make sure you have the VSTO 3.0 Runtime installed on the test machine.
You will also need to install the VSTO 3.0 Runtime Service Pack 1 if you are running Visual Studio 2008 Service Pack 1.
VSTO 4.0 Runtime is not required in your situation because it is used with add-ins created with Visual Studio 2010. Please note that the version of VSTO and runtime generally must agree with the version of Visual Studio used to create the add-in.
ere are a couple of usefull sites (I'm not going to copy and paste their advice on troubleshooting)
http://www.ceptara.com/node/183
http://blogs.msdn.com/b/vsod/archive/2008/04/22/troubleshooting-com-add-in-load-failures.aspx

Categories

Resources