Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 695
Default Disable Format menu

This code disable Format menu (whole menu)

Application.CommandBars("Format").Enabled = False

But im just vana disable Show (Format/Columns/Show or (hide)

hav do i do that ?

thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Disable Format menu

Application.CommandBars("Worksheet Menu
Bar").Controls("Format").Controls("Column").Contro ls("Hide").Enabled = False
'True
Application.CommandBars("Worksheet Menu
Bar").Controls("Format").Controls("Column").Contro ls("Unhide").Enabled =
False 'True


--
HTH

Bob

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

"excelent" wrote in message
...
This code disable Format menu (whole menu)

Application.CommandBars("Format").Enabled = False

But im just vana disable Show (Format/Columns/Show or (hide)

hav do i do that ?

thanks in advance



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 695
Default Disable Format menu

Hi bob, i get a Runtime error 5
Invalid procedure call or argument

what is this part ? sheet name or...?
("Worksheet Menu Bar").


"Bob Phillips" skrev:

Application.CommandBars("Worksheet Menu
Bar").Controls("Format").Controls("Column").Contro ls("Hide").Enabled = False
'True
Application.CommandBars("Worksheet Menu
Bar").Controls("Format").Controls("Column").Contro ls("Unhide").Enabled =
False 'True


--
HTH

Bob

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

"excelent" wrote in message
...
This code disable Format menu (whole menu)

Application.CommandBars("Format").Enabled = False

But im just vana disable Show (Format/Columns/Show or (hide)

hav do i do that ?

thanks in advance




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Disable Format menu

Bob's code might not work on non-English versions of Excel. If that's what
you have try this:

Sub DisableColHideUnhide()
Dim Ctrls As CommandBarControls
Dim Ctrl As CommandBarControl
Set Ctrls = CommandBars.FindControls(, 886)
For Each Ctrl In Ctrls
Ctrl.Enabled = False
Next
Set Ctrls = CommandBars.FindControls(, 887)
For Each Ctrl In Ctrls
Ctrl.Enabled = False
Next
End Sub


--
Jim
"excelent" wrote in message
...
| Hi bob, i get a Runtime error 5
| Invalid procedure call or argument
|
| what is this part ? sheet name or...?
| ("Worksheet Menu Bar").
|
|
| "Bob Phillips" skrev:
|
| Application.CommandBars("Worksheet Menu
| Bar").Controls("Format").Controls("Column").Contro ls("Hide").Enabled =
False
| 'True
| Application.CommandBars("Worksheet Menu
| Bar").Controls("Format").Controls("Column").Contro ls("Unhide").Enabled =
| False 'True
|
|
| --
| HTH
|
| Bob
|
| (there's no email, no snail mail, but somewhere should be gmail in my
addy)
|
| "excelent" wrote in message
| ...
| This code disable Format menu (whole menu)
|
| Application.CommandBars("Format").Enabled = False
|
| But im just vana disable Show (Format/Columns/Show or (hide)
|
| hav do i do that ?
|
| thanks in advance
|
|
|


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 695
Default Disable Format menu

ok thanks anyway Bob

Jim this work perfect thanks for ur help



"Jim Rech" skrev:

Bob's code might not work on non-English versions of Excel. If that's what
you have try this:

Sub DisableColHideUnhide()
Dim Ctrls As CommandBarControls
Dim Ctrl As CommandBarControl
Set Ctrls = CommandBars.FindControls(, 886)
For Each Ctrl In Ctrls
Ctrl.Enabled = False
Next
Set Ctrls = CommandBars.FindControls(, 887)
For Each Ctrl In Ctrls
Ctrl.Enabled = False
Next
End Sub


--
Jim
"excelent" wrote in message
...
| Hi bob, i get a Runtime error 5
| Invalid procedure call or argument
|
| what is this part ? sheet name or...?
| ("Worksheet Menu Bar").
|
|
| "Bob Phillips" skrev:
|
| Application.CommandBars("Worksheet Menu
| Bar").Controls("Format").Controls("Column").Contro ls("Hide").Enabled =
False
| 'True
| Application.CommandBars("Worksheet Menu
| Bar").Controls("Format").Controls("Column").Contro ls("Unhide").Enabled =
| False 'True
|
|
| --
| HTH
|
| Bob
|
| (there's no email, no snail mail, but somewhere should be gmail in my
addy)
|
| "excelent" wrote in message
| ...
| This code disable Format menu (whole menu)
|
| Application.CommandBars("Format").Enabled = False
|
| But im just vana disable Show (Format/Columns/Show or (hide)
|
| hav do i do that ?
|
| thanks in advance
|
|
|



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
Excel 2003 format menu disable it Setting up and Configuration of Excel 1 October 29th 07 02:15 PM
disable menu items Josh C Excel Programming 5 May 2nd 07 08:49 PM
Context Menu (Sub-Menu Disable/Enable) JR_06062005[_2_] Excel Programming 4 August 31st 06 06:01 PM
Disable Sub-Menu of a Context Menu JR_06062005[_2_] Excel Programming 1 August 29th 06 09:46 PM
disable Tool menu Sameh Farouk Excel Programming 2 April 18th 06 12:49 PM


All times are GMT +1. The time now is 12:10 PM.

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"