views:

428

answers:

2

Hi everyone, We have an application that is built with Excel as the front end using the Office object model. We were using a C++ shim to load it as a COM add in for Excel 2003, but I've updated it to use the latest VSTO for Excel 2007. I've also been using VS 2010 for the latest version. The problem is that everything works great on my dev machine in debugger mode as well as just launching Excel 2007, but I cannot get it to run on any other machine (my current target machine is Win7, development is XP). I've created a ClickOnce deployment of the Addin, and I can see it in the list of COM Addins, but when I check on it to load it nothing happens. I re-open the Addins manager and it is un-checked. I've also tried setting in in the registry, but as soon as I run it, it sets the registry back to do not load. I've tried everything I can think of and searched all over the web but no dice. Any help would be appreciated!

UPDATE: I was able to setup some VSTO Error notifications and I got this from my app as well as a basic Hello World app that I deployed with ClickOnce. I still haven't found an answer, but I do know that this errors out before the add-in can even fire the Startup event:

Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateStartupObjectException: Could not create an instance of startup object PrevisionAddIn.PrevisionAddIn in assembly PrevisionAddIn, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null. at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.ExecuteCustomization.CreateEntryPoint(String entryPointTypeName) at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.ExecuteCustomization.Microsoft.VisualStudio.Tools.Office.Runtime.Interop.IExecuteCustomization2.LoadEntryPoints(IntPtr serviceProvider)

+1  A: 

Can you disable the anti-virus software on the machine and see if that makes any difference? I have some add-ins that are deployed via ClickOnce, and one of them would never be enabled. My boss would go in and check "enable" on the screen in Outlook, and close the window, and go back in and it would be disabled. Turned out to be his anti-virus software being overzealous. Just an idea...

Also, you can't use ClickOnce for Office2003. Does this add-in still target 2003, or does it target 2007?

And if you're using ClickOnce, are you signing it with a valid certificate from a certificate authority such as Verisign? Or are you deploying to http://localhost and installing it from there (which doesn't require a certificate).

RobinDotNet
Already checked the anti-virus option and that didn't do anything. This is only for 2007. The 2003 version used a COM shim and we had a launcher application that made sure it was registered.We have a certificate so I know that's not the problem. Also, when you have an invalid certificate (or none) it tells you that when it tried to install. This can see the addin, just won't enable/load it.
Erick
Can you put a messagebox in the startup and shutdown of your add-in, and see if it's even trying to start it up and shut it down? I have found it will disable an add-in if it crashes at startup. Do you have any logging? You did run it in Visual Studio and it worked fine?
RobinDotNet
I added some message boxes and it doesn't even hit them. I setup VSTO Error Notify and I did get an error which I'll post in the next comment since I don't have enough space to put it here. I also created a "Hello World" app and published it with ClickOnce and got the same error. I appreciate you looking at this since I cannot seem to find any other help online.
Erick
See update to main question
Erick
A: 

I figured out that the problem was with the version of VS 2010 that I was using. I built the project in the Beta 2 version, and hadn't had time to upgrade. Once I did that, it worked as advertised. But I sure learned a boatload about how to get this thing up and running!

Thanks again!

-Erick

Erick
I talked to the ClickOnce product team about this, too. He said the messageboxes weren't working because it wasn't a ClickOnce problem -- the Office product was not even loading the application. Be sure you are installing the PIAs and the VSTO Runtime as prerequisites.
RobinDotNet