VSTO Second Edition Excel Addin - Method Not Found get_CommandBars

J

John Frandolig

Hello,

I have an Excel add-in Developed with VSTO in VS 2005, and it works fine on
many machines with either Excel 2003 or Excel 2007 loaded, (because it is
designed only to use 2003 features, and is linked with the 2003 PIA's)

I have a customer of this Addin, that has encountered the following error on
one machine, This machine has Office 2007, and when My addin Initializes, it
trys to add itself to the Application Commandbars collection, and fails with
this exception:

==========
Error Message:

Method not found: 'Microsoft.Office.Core.CommandBars
Microsoft.Office.Interop.Excel._Application.get_CommandBars()'.



Error Source:

Datacuity.AnyViewIDS.Excel2003AddIn



Error Details:

System.MissingMethodException: Method not found:
'Microsoft.Office.Core.CommandBars
Microsoft.Office.Interop.Excel._Application.get_CommandBars()'.

at Excel2003AddIn.ThisAddIn.CreateToolbar()

at Excel2003AddIn.ThisAddIn.ThisAddIn_Startup(Object sender, EventArgs e)
=======

I had the customer check that the Microsoft.Office.Interop.Excel Assembly
was present (version 12 in the gac, with a version 11 publisher policy file
that re-directs to 12),

and had him check the version of office.dll version 12 in the GAC. and all
looks ok, same as on my working machine.

Since I didn't originally develop this addin, just support it, (but I have
the source project), there are many things I don't completely understand:

Its a basic question, but can someone tell me where this get_CommandBars()
Method mentioned is supposed to live, and how to tell where my addin code is
actually looking for it ?

Has anyone else ever seen a similar error when running a VSTO add-in ? In
office 2007 ?

Thanks for any thoughts or comments,

John F
 
C

Cindy M.

Hi John,
Its a basic question, but can someone tell me where this get_CommandBars()
Method mentioned is supposed to live, and how to tell where my addin code is
actually looking for it ?

Has anyone else ever seen a similar error when running a VSTO add-in ? In
office 2007 ?
I can't recall having ever seen this before... I recommend you post in the VSTO
forum, as you're more likely to get a VSTO-related response there

http://social.msdn.microsoft.com/Forums/en-US/vsto/threads

It would probably help if you copy in the code, just so it's obvious how you're
working with the command bars.
I have a customer of this Addin, that has encountered the following error on
one machine
I'm guessing the problem is the machine configuration, not that add-in, itself.
It would be interesting to know if just the single user profile has the
problem, or whether it happens for all users on the machine.

In your place, I'd try writing a VBA macro that does basically what your Add-in
does with CommandBars to see if it works and, if it fails, whether the VBA
interface gives you more information about the error.

FWIW my best guess is that the user's personal workbook (personal.xslb,
usually) may be damaged. If you rename that so that starting Excel generates a
new copy, the problem could go away.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
J

John Frandolig

thanks for the suggestions Cindy,

I will try those tests (multiple user case/ personal workbook rename, macro
if I can figure out how) If it comes up again, my customer has uninstalled
office 2007 and re-installed office 2003 and the problem no longer occurs.
(though that is not really the cause (2007) - he just destroyed the evidence
for now.. - thanks again)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top