ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disabling Toolbar (https://www.excelbanter.com/excel-programming/374448-disabling-toolbar.html)

Francis Ang[_3_]

Disabling Toolbar
 
I am trying to disable the 'Insert' and 'View' of the worksheet menu bar with
the following codes -

Application.CommandBars("Insert").Enabled = false
Application.CommandBars("View").Enabled = false

but is having a problem; only 'View' is disabled but 'Insert' is not. Is
it because
"Insert" cannot be disabled in this manner? Is so, how can I disable
'Insert'.

Thank you.



Halim

Disabling Toolbar
 
Hi Ang,

Try this one :
CommandBars(1).Controls("insert").Enabled = False

Because Insert is a control of Worksheet Menu Bar is index=1
so I use 1
--

Regards,

Halim


"Francis Ang" wrote:

I am trying to disable the 'Insert' and 'View' of the worksheet menu bar with
the following codes -

Application.CommandBars("Insert").Enabled = false
Application.CommandBars("View").Enabled = false

but is having a problem; only 'View' is disabled but 'Insert' is not. Is
it because
"Insert" cannot be disabled in this manner? Is so, how can I disable
'Insert'.

Thank you.



Francis Ang[_3_]

Disabling Toolbar
 
Thanks alot Halim. Appreciate your help very much.

"Halim" wrote:

Hi Ang,

Try this one :
CommandBars(1).Controls("insert").Enabled = False

Because Insert is a control of Worksheet Menu Bar is index=1
so I use 1
--

Regards,

Halim


"Francis Ang" wrote:

I am trying to disable the 'Insert' and 'View' of the worksheet menu bar with
the following codes -

Application.CommandBars("Insert").Enabled = false
Application.CommandBars("View").Enabled = false

but is having a problem; only 'View' is disabled but 'Insert' is not. Is
it because
"Insert" cannot be disabled in this manner? Is so, how can I disable
'Insert'.

Thank you.



Ron de Bruin

Disabling Toolbar
 
Hi

Better to use Id numbers instead of the name
No problem if you run it in a non English version

See
http://www.rondebruin.nl/menuid.htm

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



"Francis Ang" wrote in message ...
Thanks alot Halim. Appreciate your help very much.

"Halim" wrote:

Hi Ang,

Try this one :
CommandBars(1).Controls("insert").Enabled = False

Because Insert is a control of Worksheet Menu Bar is index=1
so I use 1
--

Regards,

Halim


"Francis Ang" wrote:

I am trying to disable the 'Insert' and 'View' of the worksheet menu bar with
the following codes -

Application.CommandBars("Insert").Enabled = false
Application.CommandBars("View").Enabled = false

but is having a problem; only 'View' is disabled but 'Insert' is not. Is
it because
"Insert" cannot be disabled in this manner? Is so, how can I disable
'Insert'.

Thank you.





Francis Ang[_3_]

Disabling Toolbar
 
Hi Ron,

Thank you for the execellent tip. Appreciate it very much.

"Ron de Bruin" wrote:

Hi

Better to use Id numbers instead of the name
No problem if you run it in a non English version

See
http://www.rondebruin.nl/menuid.htm

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



"Francis Ang" wrote in message ...
Thanks alot Halim. Appreciate your help very much.

"Halim" wrote:

Hi Ang,

Try this one :
CommandBars(1).Controls("insert").Enabled = False

Because Insert is a control of Worksheet Menu Bar is index=1
so I use 1
--

Regards,

Halim


"Francis Ang" wrote:

I am trying to disable the 'Insert' and 'View' of the worksheet menu bar with
the following codes -

Application.CommandBars("Insert").Enabled = false
Application.CommandBars("View").Enabled = false

but is having a problem; only 'View' is disabled but 'Insert' is not. Is
it because
"Insert" cannot be disabled in this manner? Is so, how can I disable
'Insert'.

Thank you.







All times are GMT +1. The time now is 02:53 AM.

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