LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Adding menu item to Tools

I'd like to add an item to the Tools menu when I open a spreadsheet and then
delete it before the workbook closes. I've tried adding this code to the
Workbook Open event.

Private Sub Workbook_Open()
CommandBars("Worksheet men
bar").Controls("Tools").Controls.Add(Type:=msoCont rolButton).Caption="MyMenu"
End Sub

When I open the spreadsheet, I get an error 91: Object Variable or With
block variable not set.

This same codes works if I include it in the code I have for a userform I've
defined to take inputs from the user.

Ideas?


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
No Data Analysis item in Excel Tools menu. Now what? ainoni Excel Worksheet Functions 4 September 23rd 08 07:44 PM
Adding a menu item to Excel Uzi Barzilai Excel Discussion (Misc queries) 1 January 14th 08 10:25 AM
Adding Separator Menu Item - Excel 2003 Desi Excel Programming 2 June 9th 05 10:21 AM
Adding a Menu Item into a sheet as a button [email protected] Excel Programming 3 March 23rd 05 06:37 PM
Adding a menu item right click menu when clicking on a single. Andoni[_28_] Excel Programming 0 September 2nd 04 10:23 PM


All times are GMT +1. The time now is 08:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"