View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Problem in Excel 2002 vs Excel 97

Ed,

The dots are missing in front of "Add" and "Item" in both
portions of the sub. The code won't run without them.

The first portion leaves a blank button on the menu bar and
renames the button to the right of it.

Excel cannot find the "Custom Popup 1" control.
I would have to assume it is missing or was renamed.

Regards,
Jim Cone
San Francisco, USA


"ed_vak" wrote in
message ...

This code below works fine in Excel 97 on NT.
After one of our machines was upgraded to XP with Excel 2002 it stop
working with Run-time Error 5 on the second "With..." the first one is
OK:

Sub MakeToolBar()

With Application.CommandBars(1).Controls
Add Type:=msoControlPopup, Befo=11
Item(.Count).Caption = "GEF Fi&xes"
Item(.Count).Tag = "GEF Fixes"
End With

With Application.CommandBars("Custom Popup 1").Controls
Add Type:=msoControlButton, Befo=1
Item(.Count).Caption = "Fix &Me"
Item(.Count).OnAction = "FixMe"
End With
End Sub

Any help or ideas will be greatly appreciated.
Thank you.
Ed