Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default How to identify active Menu Bars

Hi,

I need a sub procedure that identifies all active Menu Bars when opening a
workbook.

- Then store the ID
- disable all found Menus
- active a customized Menu (That works already)

before closing Workbook:
- disable customized Menu (That works already)
- enable alle menus that was active in the beginning

I tried something with .findcontrols but I coudn't get it running.

Thanks!!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How to identify active Menu Bars


This isn't an exact answer to you question, but maybe it can be adapted
for your purpose?

I have since adapted to store in a worksheet array rather tha in a
global array, but that code is at work and I will be away from work for
several weeks.

See the following:
http://www.excelforum.com/showthread.php?t=497189


--
DCSwearingen

Getting old, but love computers.
------------------------------------------------------------------------
DCSwearingen's Profile: http://www.excelforum.com/member.php...o&userid=21506
View this thread: http://www.excelforum.com/showthread...hreadid=568775

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default How to identify active Menu Bars

Option Explicit

Private mFormulaBar

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = True
Next oCB

Application.DisplayFormulaBar = mFormulaBar
End Sub

Private Sub Workbook_Open()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = False
Next oCB

mFormulaBar = Application.DisplayFormulaBar
Application.DisplayFormulaBar = False
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Matz" wrote in message
...
Hi,

I need a sub procedure that identifies all active Menu Bars when opening a
workbook.

- Then store the ID
- disable all found Menus
- active a customized Menu (That works already)

before closing Workbook:
- disable customized Menu (That works already)
- enable alle menus that was active in the beginning

I tried something with .findcontrols but I coudn't get it running.

Thanks!!



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default How to identify active Menu Bars

Hey Bob

you are great! Perfect - just copy paste....
Thanks for the sunday highlight in VBA :-)
Matz

"Bob Phillips" wrote:

Option Explicit

Private mFormulaBar

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = True
Next oCB

Application.DisplayFormulaBar = mFormulaBar
End Sub

Private Sub Workbook_Open()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = False
Next oCB

mFormulaBar = Application.DisplayFormulaBar
Application.DisplayFormulaBar = False
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Matz" wrote in message
...
Hi,

I need a sub procedure that identifies all active Menu Bars when opening a
workbook.

- Then store the ID
- disable all found Menus
- active a customized Menu (That works already)

before closing Workbook:
- disable customized Menu (That works already)
- enable alle menus that was active in the beginning

I tried something with .findcontrols but I coudn't get it running.

Thanks!!




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
Delete custom menu bars Martin Walter Setting up and Configuration of Excel 1 June 27th 06 01:15 PM
Disappearing Tool and menu bars J Streger Excel Discussion (Misc queries) 3 March 8th 06 03:42 AM
Lost all my menu bars and tool bars CathyJ Excel Discussion (Misc queries) 3 August 8th 05 12:49 PM
How do I restore my menu and tool bars in Excell? Football Excel Discussion (Misc queries) 3 May 30th 05 07:20 PM
I have lost my menu bars in Excel? ksj Excel Discussion (Misc queries) 5 February 24th 05 05:17 PM


All times are GMT +1. The time now is 06:46 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"