ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel 2003: Customizing Toolbars (https://www.excelbanter.com/excel-programming/422709-re-excel-2003-customizing-toolbars.html)

eggpap[_14_]

Excel 2003: Customizing Toolbars
 

Hello, I have a wb with built in commandbars and toolbars customized on
the activate wb event and resetted on the deactivate wb event. I'ld like
to know if it is possible to prevent the user to disable the macro at
the start of the wb and to customize the menus/toolbars. Moreover I can
disable a commandbar (for example "Tools") getting it grayed on the
worksheet menubar, but I'm not able to hide it completely.

I have used this

Application.CommandBars("Tools").enabled=False

and these

Application.CommandBars("Tools").enabled=False
Application.CommandBars("Tools").visible=False

but with these I'm able to hide only the toolbars (e.g. Standard tb).

Emiliano


--
eggpap

Excel 2003 on Vista HP System - can use VBA
------------------------------------------------------------------------
eggpap's Profile: http://www.thecodecage.com/forumz/member.php?userid=90
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=13064


stefan onken

Excel 2003: Customizing Toolbars
 
hi Emiliano, try

Application.Commandbars(1).Controls("Tools").Enabl ed =False

CommandBars(1) is also Commandbars("Worksheet Menu Bar")

stefan

On 20 Jan., 15:47, eggpap wrote:
Hello, I have a wb with built in commandbars and toolbars customized on
the activate wb event and resetted on the deactivate wb event. I'ld like
to know if it is possible to prevent the user to disable the macro at
the start of the wb and to customize the menus/toolbars. Moreover I can
disable a commandbar (for example "Tools") getting it grayed on the
worksheet menubar, but I'm not able to hide it completely.

I have used this

Application.CommandBars("Tools").enabled=False

and these

Application.CommandBars("Tools").enabled=False
Application.CommandBars("Tools").visible=False

but with these I'm able to hide only the toolbars (e.g. Standard tb).

Emiliano

--
eggpap

Excel 2003 on Vista HP System - can use VBA
------------------------------------------------------------------------
eggpap's Profile:http://www.thecodecage.com/forumz/member.php?userid=90
View this thread:http://www.thecodecage.com/forumz/sh...ad.php?t=13064



eggpap[_15_]

Excel 2003: Customizing Toolbars
 

thanks Stefan.

I have the following code modified according to your tip

'to hide the Standard and Formatting tb correctly performing
Application.CommandBars("Standard").Enabled = False
Application.CommandBars("Standard").Visible = False
Application.CommandBars("Formatting").Enabled = False
Application.CommandBars("Formatting").Visible = False

'To hide the CommandBar Help - *I get error 5*

Application.CommandBars(1).Controls("Help").Enable d = False

Any other tip?
Emiliano


--
eggpap

Excel 2003 on Vista HP System - can use VBA
------------------------------------------------------------------------
eggpap's Profile: http://www.thecodecage.com/forumz/member.php?userid=90
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=13064


stefan onken

Excel 2003: Customizing Toolbars
 
hi Emiliano,
do you have a Control with the Caption "Help" or do you mean the
"?" (which is the caption for the help in german excel, i`m not sure
if itīs the same in english)
try Application.CommandBars(1).Controls("?").Enabled = False

stefan

'To hide the CommandBar Help - *I get error 5*

Application.CommandBars(1).Controls("Help").Enable d = False

Any other tip?
Emiliano

--


eggpap[_16_]

Excel 2003: Customizing Toolbars
 

Dear Stefan,

I'm an Italian user. The Help control is only one of the controls I
need to hide. I get the same error with other controls. My first try was
supposing the controls captions was the same I see on the Worksheet Menu
Bar but I got "good" results only using the english caption.

Emiliano


--
eggpap

Excel 2003 on Vista HP System - can use VBA
------------------------------------------------------------------------
eggpap's Profile: http://www.thecodecage.com/forumz/member.php?userid=90
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=13064


stefan onken

Excel 2003: Customizing Toolbars
 
hi Emiliano,
hmm, do you mean the Help right of the Worksheet Menu Bar, where you
can type your question?
This will be disabled with
Application.CommandBars.DisableAskAQuestionDropdow n = True

to disable all Commandbars, you can use

For Each cb in Application.CommandBars
cb.Enabled =False
Next

and with the same just True instead of False the visible CommandBars
will be restored.

stefan

On 20 Jan., 20:13, eggpap wrote:
Dear Stefan,

I'm an Italian user. The Help control is only one of the controls I
need to hide. I get the same error with other controls. My first try was
supposing the controls captions was the same I see on the Worksheet Menu
Bar but I got "good" results only using the english caption.

Emiliano



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

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