Customized Toolbar and Excel 98

P

p

I created my customized Excel Toolbar in Excel 97 using
the following code

'This creates the toolbar for filling the survey
Public Sub CreateToolbar()
Dim oToolbar As CommandBar
Dim oButton As CommandBarControl
Set oToolbar = Application.CommandBars.Add
(MAIN_TOOLBAR_NAME, , , True)
oToolbar.Visible = True
'puts the toolbar at the top of the screen
oToolbar.position = msoBarTop

When I port it to Excel 98 some of the buttons work,
however, when I click on one of the buttons, I get a run-
time error of '32809' - Application-defined or object-
defined error;

1) Does this mean that the toolbar is an Active X control
and hence, not supported in Excel 98?

2) Does 98 have the ability to create toolbar buttons like
in 97 or do we have to use existing macro buttons (with
the option to change the button image with different
icons)?

Thanx in advance.
 
J

J.E. McGimpsey

p said:
Here is my problem ==> When I port it to Excel 98 some of
the buttons work, however, when I click on one of the
buttons, I get a run-time error of '32809' - Application-
defined or object-defined error;

1) Does this mean that the CommandBar and
CommandBarControl objects are not recognized in
Excel 98?

Since you're able to click on the buttons, I'd say XL98 is
recognizing both the CommandBar and the CommandBarControl objects.

2) Does 98 have the ability to create toolbar buttons like
in 97 or do we have to use existing macro buttons (with
the option to change the button image with different
icons)?

XL98 can, as you've demonstrated, make CommandBarControls (buttons,
comboboxes and popups) just like XL97. XL98 cannot make ActiveX
controls.

The technique you outline is how I build my custom toolbar (I hide
the standard ones). Some of the buttons on that toolbar use the ID
of an existing button, but others are tied to macros.

It sounds like you've got something in the "one" button's OnAction
item. What is that code attempting to do?
 

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