G
Guest
I got some great help here last night, so I thought I'd try again. I'm
creating a custom menu for a 29 worksheet template. I can run the following
code on new workbooks, but I can run it on the one that I need, the template.
Sub Auto_Open()
Dim HelpIndex As Integer
Dim NewMenu As CommandBarPopup
' Get Index of Help menu
HelpIndex = CommandBars(1).Controls("Help").Index
' Create the control
Set NewMenu = CommandBars(1) _
.Controls.Add(Type:=msoControlPopup, _
Before:=HelpIndex, Temporary:=True)
' Add a caption
NewMenu.Caption = "&Custom Menu"
End Sub
I get the following error:
Compile error:
User-Defined Type Not Defined
And it highlights the following line:
NewMenu As CommandBarPopup
Does anyone have any idea of why it doesn't work on this particluar workbook?
Any comments are appreciated.
Renato
creating a custom menu for a 29 worksheet template. I can run the following
code on new workbooks, but I can run it on the one that I need, the template.
Sub Auto_Open()
Dim HelpIndex As Integer
Dim NewMenu As CommandBarPopup
' Get Index of Help menu
HelpIndex = CommandBars(1).Controls("Help").Index
' Create the control
Set NewMenu = CommandBars(1) _
.Controls.Add(Type:=msoControlPopup, _
Before:=HelpIndex, Temporary:=True)
' Add a caption
NewMenu.Caption = "&Custom Menu"
End Sub
I get the following error:
Compile error:
User-Defined Type Not Defined
And it highlights the following line:
NewMenu As CommandBarPopup
Does anyone have any idea of why it doesn't work on this particluar workbook?
Any comments are appreciated.
Renato