tags:

views:

80

answers:

1

I've created an Excel add-in using Visual Studio 2008. It has a ribbon, a bunch of panes and code that adds sheets and ranges and gets information scraped from a web page.

When I run it on my dev PC it works perfectly. I used the Publish command to publich it and installed on a Windows XP virtual PC. The installation seemed fine and when I open Excel I see my ribbon. If I click a button that shows a pane, up pops the pane. If I enter some details into the pane that should create a range and populate it with data from a web page, the range is created but the web page is not visited (I have tested that I have connectivity). One of my buttons adds a hidden worksheet and another displays or hides that sheet. One of these buttons is not working.

I've tried everything I can think of. I'm wondering if there are any permissions or trust issues I need to deal with?

+1  A: 

One possible explanation is that an exception is occurring and the execution is halted without warning. In VSTO, to my knowledge, there is no easy way to centralize error handling and at least perform logging of the errors. If the code throwing the exception is not surrounded with a try/catch the exception will just interrupt execution.

So if you haven't done that already, I suggest that you surround all execution entry points like event handlers triggered by user actions (button clicks, etc) with try/catch and log the exceptions.

If you have a lot of these cases you can check the following article (shameless plug) for a possible simplification of this process.

Centralizing VSTO Add-in Exception Management with PostSharp

João Angelo
I'll try adding some additional try/catches.
Dan Crowther
Found the issue (though I don't know the solution yet). The try/catch showed up the exception "Unrecognized element 'extendedProtectionPolicy'". I think it's something to do with how it calls the web service but need to do some more research.
Dan Crowther
In case anyone else sees the above error, it appears Windows 7 adds this configuration item and Windows XP doesn't like it. If you remove the setting from the app.config, the problem goes away.
Dan Crowther
Might be worth add that as an answer rather than a comment - very useful!
Jonners
@Dan Crowther, do you have different .NET Framework versions installed? Like for example, 3.5 on Win7 and just 2.0 on WinXP?
João Angelo