Commandbars and embedded objects

K

keksforscher

Hello,

I have Word and Excel. In both apps I have a macro which uses an own
commandbar.

I have a word-doc with an embedded excel-object. If I activate the
excel-object the commandbar from my word-macro is replaced by the
commandbar from my excel-macro.

How can I avoid this?

I need two solutions:

First: A way in word or excel which allows me to specify that a
commandbar never gets replaced by an activated OLE-Object
Second: A ways to find out if my word or excel runs as an embedded
oleobject to disable my commandbar.

Thanks

Stefan
 
C

Chay Harley

Assuming that your commandBar is created through VBA, you'll need to rewrite
the vba such that the "name" assigned to the commandbar is different. Open
the VBA editor (Alt+F11) for word (don't activate the excel component) and
navigate to the code that creates the commandBar.
Change the code that specifies the name of the commandBar (even just add a 1
after the name, ie. "bar1")
After that, you might have two similar buttons, but at least you won't have
it getting replaced.
Save and close/reopen word and then the word file for the changes to take
effect.

If you've created it through right-clicking and customise on the toolbar
section, then... you should split the embedded Excel object out of the word
document and use it in Excel.

If you don't have an IT department to do this work for you, you might want
to pick up a book on programming VBA. It will be a very good investment.

Cheers,
Chay Harley
 

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