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.
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:
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:
In the final step I wrote the following simple code in a Button Click event:
I also created a similar small project in C# as the following image shows:
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:
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.