ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to disable and hide ALL menu in Excel 2007? (https://www.excelbanter.com/excel-programming/407624-how-disable-hide-all-menu-excel-2007-a.html)

marcus

How to disable and hide ALL menu in Excel 2007?
 
Hi guys,

I need your help !!

Any idea how to disable in VBA all menus in EXCEL 2007?

On the top of that I need to hide also the main title on the top with Excel
+ name of the file appear - so it doesn't look Excel any more

Many thanks for your precious help!

Yvan

Bob Phillips

How to disable and hide ALL menu in Excel 2007?
 
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


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Marcus" wrote in message
...
Hi guys,

I need your help !!

Any idea how to disable in VBA all menus in EXCEL 2007?

On the top of that I need to hide also the main title on the top with
Excel
+ name of the file appear - so it doesn't look Excel any more

Many thanks for your precious help!

Yvan




marcus

How to disable and hide ALL menu in Excel 2007?
 
GREAT!!!! THANK YOU Phillips

BTW, do you know how we can remove the Excel green flag (top left), NAME of
the file (top middle) and the red cross (top right)?

Many thanks for you help!!!!

Yvan

"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


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Marcus" wrote in message
...
Hi guys,

I need your help !!

Any idea how to disable in VBA all menus in EXCEL 2007?

On the top of that I need to hide also the main title on the top with
Excel
+ name of the file appear - so it doesn't look Excel any more

Many thanks for your precious help!

Yvan






All times are GMT +1. The time now is 03:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com