Creating a menu item Excel 2003 on Open

GreenyMcDuff

Active Member
Joined
Sep 20, 2010
Messages
313
Hi all,

I usually use excel 2007, when I create a macro I usually assign it a button on the add-ins tab on the ribbon.

However, I have created a macro for use in 2003 only. I want to assign a custom button to the macro and tried using the same code:

Code:
Sub auto_open()
On Error Resume Next
Application.CommandBars("Security Type Identifier").Delete
Set mybar = CommandBars _
    .Add(Name:="Security Type Identifier", Position:=msoBarTop, _
    Temporary:=True)
    mybar.Visible = True
Set newbutton = mybar.Controls _
    .Add(Type:=msoControlButton)
With newbutton
        .Style = msoButtonCaption
        .Caption = "Run Security Type Identifier"
        .OnAction = "Data"
End With

End Sub

Sub auto_close()
On Error Resume Next
Application.CommandBars("Security Type Identifier").Delete
End Sub

I assume this isn't compatible with excel 2003, does anyone know how to make it so?

Thanks

Chris
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
That code should be perfectly compatible with 2003. What is the actual problem?
 
Upvote 0
Turns out I am the actual problem :S

Sorry for wasting your time Rory, I just looked in 2003 and the menu item had appeared under the toolbar.
 
Upvote 0
Well, I didn't like to assume... ;)
 
Upvote 0

Forum statistics

Threads
1,224,607
Messages
6,179,871
Members
452,949
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top