Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Customizing a menu bar...

Exel Helper

I am building an Excel spreadsheet and want to add a new menu item of the
menu bar. I have manged to do this ok.

The issue is that whenever I open another Excel workbook the same menu bar
appears. I want the menu bar to be spcecific to one workbook only.

In my my workbook and used the Workbook_Open event and Workbook_BeforeClose
event to add and delete the menu item when the workbook was opened and closed.

I assumed that this would menu that the new menu bar only appears in that
workbook. However, if I have that workbook open, and then open an new Excel
workbook, then the new workbook 'inherits' the new menu bar too.

How can I get around this? I know that if you make changes to toolbars then
they will be saved and be 'permanent' in Excel. However, if I use the event
handlers in a given workbook I thought that would confine the changes in a
menu bar to that workbook only?

Regards


Alex
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default Customizing a menu bar...

In your events, make the visibility of the menu dependent on the name of the
workbook: use ActiveWorkbook.Fullname or ActiveWorkbook.Name

"Alex" wrote:

Exel Helper

I am building an Excel spreadsheet and want to add a new menu item of the
menu bar. I have manged to do this ok.

The issue is that whenever I open another Excel workbook the same menu bar
appears. I want the menu bar to be spcecific to one workbook only.

In my my workbook and used the Workbook_Open event and Workbook_BeforeClose
event to add and delete the menu item when the workbook was opened and closed.

I assumed that this would menu that the new menu bar only appears in that
workbook. However, if I have that workbook open, and then open an new Excel
workbook, then the new workbook 'inherits' the new menu bar too.

How can I get around this? I know that if you make changes to toolbars then
they will be saved and be 'permanent' in Excel. However, if I use the event
handlers in a given workbook I thought that would confine the changes in a
menu bar to that workbook only?

Regards


Alex

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Customizing a menu bar...

Put the menu build in the main workbook's Workbook_Activate event, and
remove it in the Deactivate event.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Alex" wrote in message
...
Exel Helper

I am building an Excel spreadsheet and want to add a new menu item of the
menu bar. I have manged to do this ok.

The issue is that whenever I open another Excel workbook the same menu bar
appears. I want the menu bar to be spcecific to one workbook only.

In my my workbook and used the Workbook_Open event and

Workbook_BeforeClose
event to add and delete the menu item when the workbook was opened and

closed.

I assumed that this would menu that the new menu bar only appears in that
workbook. However, if I have that workbook open, and then open an new

Excel
workbook, then the new workbook 'inherits' the new menu bar too.

How can I get around this? I know that if you make changes to toolbars

then
they will be saved and be 'permanent' in Excel. However, if I use the

event
handlers in a given workbook I thought that would confine the changes in a
menu bar to that workbook only?

Regards


Alex



Reply
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
Customizing the menu in excel 2007 Gilbert Excel Discussion (Misc queries) 5 September 22nd 07 12:10 AM
Customizing Worksheet Menu Bar for a workbook without VBA coding Sylvia Excel Discussion (Misc queries) 0 March 20th 06 07:20 AM
Customizing Worksheet Menu Bar question. Help! [email protected] Excel Discussion (Misc queries) 0 October 26th 05 02:28 PM
Customizing right click menu Dad of 7 Excel Programming 1 January 27th 05 01:28 PM
Customizing VB Macro on Menu Bar Keda Wang Excel Programming 5 January 25th 04 03:45 PM


All times are GMT +1. The time now is 07:37 PM.

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"