VSTO & .NET & Excel

December 26, 2007

Excel 2003 & Windows Vista bug?

Filed under: .NET & Excel, COM Add-ins, VSTO & Excel — Dennis M Wallentin @ 9:56 pm

Introduction
After the release of .NET Co Library I immediately received some inputs indicating that the add-in does not work with Excel 2003 on Windows Vista. For some unknown reasons, at least for me, this configuration was not tested before I released the add-in. (It was tested on Windows Vista where Office 2003 and Office 2007 coexisted but not Office 2003 alone on Windows Vista.)

Initially I thought it was related to the add-in itself and how it added the main menu item to the standard toolbar in the VB Editor. But when I made some additional debugging and tests it turned out to be related to Excel 2003 when running it on Windows Vista. 

The case 
I set up the following vmWare configuration:

  • Windows Vista Business
  • Office 2003 Professional Edition & Service Pack 3
  • Visual Studio 2008 

I made sure that the security settings in Excel 2003 were correct as the following image shows:

security-settings-excel-2003.png 

It does not exist any activated add-ins at all. Next I created a small Windows Form project with VB and made sure that all references to Excel existed as the following image shows:

references-excel-2003.png
 

In the final step I wrote the following simple code in a Button Click event:

code-excel-2003.png

I also created a similar small project in C# as the following image shows: 

error-automation-c_.png


Programmatic access to Visual Basic Project is not trusted
When the above code was executed it showed the first message correctly while it generated the following error message when trying to access the VBE’s toolbar:

automation-excel-2003.png

A bug?
When running Excel 2003 & SP-3 on Windows XP Professional it works as expected. (It also works as expected when Office 2003 and Office 2007 coexist on Windows Vista. I’m aware of that this configuration is not recommended and is not supported.)

The only scenario I can raise this error is when using Excel 2003 on Windows Vista. I have also tested to turn off the UAC but with any success, i e the error still appears. The same error is raised when running a Shared add-in with the above code. It is also applicable to Add-in Express .NET solutions as well. As for VSTO I have not tested it.

For me it is important to know if this is related to some setting I have overlooked or if it is a bug.

If anyone can shed some light over it please let me know.

Kind regards,
Dennis

Advertisements

6 Comments »

  1. Interesting Dennis,
    Any luck hunting down the bug? doubly interesting that it works ok if with 2003 and 2007 are dual installed?!!?!
    Here there is a situation where a none supported set up works and a supported one does not!!
    Amazing!
    cheers
    Ross

    Comment by Ross — March 7, 2008 @ 4:52 pm

  2. Ross,

    Thanks for the input. I have received some feedback on the subject but no one solve the issue.

    I suspect it’s related to the PIAs which may explain why the add-in works with Excel 2003 when Excel 2007 is present.

    Although this scenario is not officialy supported by neither MSFT or Add-in Express it seems to work well.

    Kind regards,
    Dennis

    Comment by Dennis Wallentin — March 7, 2008 @ 8:32 pm

  3. Did you find any solution for this bug
    Excel addin on vista with office 2k3.

    I am having the same problem . My addin works with All OS (2k,2k3,xp) with all Excel flaivor(2k,2k3,2k7 and xp)
    It even works with vista+office 2k7
    but does not work with with vista +office 2k3

    Comment by Maysam — July 4, 2008 @ 12:05 am

  4. Hi Maysam,

    Thanks for Your comment. No, upto this date I have not been able to resolve it.

    I’ve made posts on MSDN’s forum but all I got in feedback was nothing, i e no comments.

    Kind regards,
    Dennis

    Comment by Dennis Wallentin — July 4, 2008 @ 10:53 am

  5. Has there been any solution for this bug since July?

    Thanks!

    Comment by Nicole — December 10, 2008 @ 4:14 pm

    • Unfortunately not…
      Some people have reported that they have no issues with it while other face the same case as we do.

      Kind regards,
      Dennis

      Comment by Dennis Wallentin — December 11, 2008 @ 2:55 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: