ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disable control (https://www.excelbanter.com/excel-programming/374550-disable-control.html)

Francis Ang[_3_]

Disable control
 
When you click on the Excel icon which appears on the top left hand corner of
a workbook, several commands become available. Can I disable the command
say 'New Window' using vba? Any help is very much appreciated.

Ron de Bruin

Disable control
 
Hi Francis

Start here
http://www.rondebruin.nl/menuid.htm

To disable the whole bar use
Application.CommandBars("Document").Enabled = False


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Francis Ang" wrote in message ...
When you click on the Excel icon which appears on the top left hand corner of
a workbook, several commands become available. Can I disable the command
say 'New Window' using vba? Any help is very much appreciated.




Peter T

Disable control
 
bEnabled = False
' only disable 'New Window'
Application.CommandBars.FindControl(ID:=303).Enabl ed = bEnabled

' or desable the menu
Application.CommandBars("Document").Enabled = bEnabled
' don't forget to reset these to True

Regards,
Peter T

"Francis Ang" wrote in message
...
When you click on the Excel icon which appears on the top left hand corner

of
a workbook, several commands become available. Can I disable the command
say 'New Window' using vba? Any help is very much appreciated.




Francis Ang[_3_]

Disable control
 
Hi Ron, Peter,

Thank you very much for the replies. Really appreciate your advice.

"Peter T" wrote:

bEnabled = False
' only disable 'New Window'
Application.CommandBars.FindControl(ID:=303).Enabl ed = bEnabled

' or desable the menu
Application.CommandBars("Document").Enabled = bEnabled
' don't forget to reset these to True

Regards,
Peter T

"Francis Ang" wrote in message
...
When you click on the Excel icon which appears on the top left hand corner

of
a workbook, several commands become available. Can I disable the command
say 'New Window' using vba? Any help is very much appreciated.






All times are GMT +1. The time now is 02:58 PM.

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