Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Arrary with Findcontrol

Hi,
I have used the following code to disable all menu bar items except File and
Help. Is there a simpler way of writing this code. My code works but I am
just curious.

Any help is appreciated.

Regards
Moody
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Array with Findcontrol

sorry forgot to add my code:
With Application.CommandBars("Worksheet Menu Bar")
.FindControl(ID:=30003).Enabled = False
.FindControl(ID:=30004).Enabled = False
.FindControl(ID:=30005).Enabled = False
.FindControl(ID:=30006).Enabled = False
.FindControl(ID:=30007).Enabled = False
.FindControl(ID:=30011).Enabled = False
.FindControl(ID:=30009).Enabled = False
.FindControl(ID:=3, Recursive:=True).Enabled = False
.FindControl(ID:=748, Recursive:=True).Enabled = False
.FindControl(ID:=3823, Recursive:=True).Enabled = False
.FindControl(ID:=846, Recursive:=True).Enabled = False
End With


Hi,
I have used the following code to disable all menu bar items except File and
Help. Is there a simpler way of writing this code. My code works but I am
just curious.

Any help is appreciated.

Regards
Moody

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Array with Findcontrol

Moody,

Here's a start:

Sub test()

Dim find_control_array
Dim find_control

With Application.CommandBars("Worksheet Menu Bar")
find_control_array = Array(30003, 30004) ' add the rest
For Each find_control In find_control_array
.FindControl(ID:=find_control).Enabled = False
Next find_control
'another loop here with the recursive argument
End With


End Sub

hth,

Doug Glancy

"Moody" wrote in message
...
sorry forgot to add my code:
With Application.CommandBars("Worksheet Menu Bar")
.FindControl(ID:=30003).Enabled = False
.FindControl(ID:=30004).Enabled = False
.FindControl(ID:=30005).Enabled = False
.FindControl(ID:=30006).Enabled = False
.FindControl(ID:=30007).Enabled = False
.FindControl(ID:=30011).Enabled = False
.FindControl(ID:=30009).Enabled = False
.FindControl(ID:=3, Recursive:=True).Enabled = False
.FindControl(ID:=748, Recursive:=True).Enabled = False
.FindControl(ID:=3823, Recursive:=True).Enabled = False
.FindControl(ID:=846, Recursive:=True).Enabled = False
End With


Hi,
I have used the following code to disable all menu bar items except File

and
Help. Is there a simpler way of writing this code. My code works but I

am
just curious.

Any help is appreciated.

Regards
Moody



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Array with Findcontrol

I tried and it works. Thanks a lot Doug, I appreciate your help.

"Doug Glancy" wrote:

Moody,

Here's a start:

Sub test()

Dim find_control_array
Dim find_control

With Application.CommandBars("Worksheet Menu Bar")
find_control_array = Array(30003, 30004) ' add the rest
For Each find_control In find_control_array
.FindControl(ID:=find_control).Enabled = False
Next find_control
'another loop here with the recursive argument
End With


End Sub

hth,

Doug Glancy

"Moody" wrote in message
...
sorry forgot to add my code:
With Application.CommandBars("Worksheet Menu Bar")
.FindControl(ID:=30003).Enabled = False
.FindControl(ID:=30004).Enabled = False
.FindControl(ID:=30005).Enabled = False
.FindControl(ID:=30006).Enabled = False
.FindControl(ID:=30007).Enabled = False
.FindControl(ID:=30011).Enabled = False
.FindControl(ID:=30009).Enabled = False
.FindControl(ID:=3, Recursive:=True).Enabled = False
.FindControl(ID:=748, Recursive:=True).Enabled = False
.FindControl(ID:=3823, Recursive:=True).Enabled = False
.FindControl(ID:=846, Recursive:=True).Enabled = False
End With


Hi,
I have used the following code to disable all menu bar items except File

and
Help. Is there a simpler way of writing this code. My code works but I

am
just curious.

Any help is appreciated.

Regards
Moody




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
Findcontrol for submenu item? Doug Glancy Excel Programming 2 November 30th 04 06:00 AM
Findcontrol Alec Bowman Excel Programming 6 April 12th 04 12:26 AM
FindControl ?!? Tom Excel Programming 3 January 22nd 04 09:57 PM


All times are GMT +1. The time now is 08:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"