Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
Unable to Run Code on Specific workbook
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Renato, post: 5971234"] 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 [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
Unable to Run Code on Specific workbook
Top