Hello,
I seem to be having trouble with the following code:
Sub Workbook_Open()
Dim CustomMenu As Object
Set CustomMenu = CommandBars("Worksheet Men
Bar").Controls.Add(Type:=msoControlPopup, Befo=10)
With CustomMenu
.Caption = "CustomMenu"
End With
End Sub
Which keeps giving me:
Run-time error '91':
Object or with variable not set
for some reason. However, this code works just fine when saved in it
own separate module in a workbook.
I am new to Excel programming, but this seems strange. Could someon
tell me what I'm doing wrong?
Thanks in advance
--
Message posted from
http://www.ExcelForum.com