Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Tom is offline
external usenet poster
 
Posts: 38
Default FindControl ?!?

Hi

The FindControl returns the first element or Nothing, if no control was
found. But I want to find all controls, that are available. How to do?

Tom


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default FindControl ?!?

Tom,

It isn't clear what you are trying to do, but Office 2000 and
later supports the FindControls method that will return a
collection of controls.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Tom" wrote in message
...
Hi

The FindControl returns the first element or Nothing, if no

control was
found. But I want to find all controls, that are available. How

to do?

Tom




  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Tom is offline
external usenet poster
 
Posts: 38
Default FindControl ?!?

Chip

I need to find all sorting buttons (IDs 210, 211, 1209, 6687) that are in
the toolsbars of Excel. In a second step the enabled-property of all these
controls must be set to false. The tool should work for Excel 97, 2000, XP &
2003.

Tom





"Chip Pearson" schrieb im Newsbeitrag
...
Tom,

It isn't clear what you are trying to do, but Office 2000 and
later supports the FindControls method that will return a
collection of controls.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Tom" wrote in message
...
Hi

The FindControl returns the first element or Nothing, if no

control was
found. But I want to find all controls, that are available. How

to do?

Tom






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default FindControl ?!?

Hi Tom

This will work in 97-2003

Sub menuItem_EnabledFalse()
Dim a As Integer
On Error Resume Next
For a = 1 To Application.CommandBars.Count
For Each ctl In CommandBars(a).Controls
Application.CommandBars(a).FindControl(Id:=210, Recursive:=True).Enabled = False
Next ctl
Next a
End Sub

Sub menuItem_EnabledTrue()
Dim a As Integer
On Error Resume Next
For a = 1 To Application.CommandBars.Count
For Each ctl In CommandBars(a).Controls
Application.CommandBars(a).FindControl(Id:=210, Recursive:=True).Enabled = True
Next ctl
Next a


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Tom" wrote in message ...
Chip

I need to find all sorting buttons (IDs 210, 211, 1209, 6687) that are in
the toolsbars of Excel. In a second step the enabled-property of all these
controls must be set to false. The tool should work for Excel 97, 2000, XP &
2003.

Tom





"Chip Pearson" schrieb im Newsbeitrag
...
Tom,

It isn't clear what you are trying to do, but Office 2000 and
later supports the FindControls method that will return a
collection of controls.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Tom" wrote in message
...
Hi

The FindControl returns the first element or Nothing, if no

control was
found. But I want to find all controls, that are available. How

to do?

Tom








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



All times are GMT +1. The time now is 06:45 PM.

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"