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

While in Design mode, when you select a control, its name should be displayed
in the Name box (on the left of the excel formula bar).
So:
- if the Formula bar is not visible, you can display it by going in menu
View Formula Bar
- to switch modes Design/Run, click the Design Mode icon from the Visual
Basic toolba. You can display this toolbar through the menu View Tollbars
Visual Basic.

VBA:
For OLEObjects controls, they should be directly accessible:
Sheet1.Combobox1.ListIndex
For other objects, you should be able to access them through the Shapes
collection:
Activesheet.Shapes("Chek Box 3")...

I hope this helps,
Sebastien

"wysimdnwyg" wrote:

I have a control on my worksheet (not a User Form) that I want to disable or
remove when a certain field is populated. The problem is, I can not find the
name of the control. I can get to the 'Format Control' window, but that's no
help. Where can I find the name of that control?

thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Disable Excel Control

You're welcome.
Accessing control properties:
-In the case of an OLECOntrol (the ones from the Control Toolbox toobar):
'Example with a checkbox
Dim cbx As MSForms.CheckBox
Set cbx = ActiveSheet.OLEObjects("Checkbox1")
cbx.Enabled = False
-In the case of a Form (the ones from the Forms toolbar, or drawing toolbar)
Dim shCbx As CheckBox
Set shCbx = ActiveSheet.CheckBoxes("Check Box 3")
shCbx.Enabled = False

Regards,
Sebastien

"wysimdnwyg" wrote:

Well, now I feel a little stupid and a little blind. That helps, and I thank
you. One more question, though. Now that I've found the control name, I
can't get it to disable. I've tried .disable, .enable = false and
.visible=false.

Thanks


"sebastienm" wrote:

While in Design mode, when you select a control, its name should be displayed
in the Name box (on the left of the excel formula bar).
So:
- if the Formula bar is not visible, you can display it by going in menu
View Formula Bar
- to switch modes Design/Run, click the Design Mode icon from the Visual
Basic toolba. You can display this toolbar through the menu View Tollbars
Visual Basic.

VBA:
For OLEObjects controls, they should be directly accessible:
Sheet1.Combobox1.ListIndex
For other objects, you should be able to access them through the Shapes
collection:
Activesheet.Shapes("Chek Box 3")...

I hope this helps,
Sebastien

"wysimdnwyg" wrote:

I have a control on my worksheet (not a User Form) that I want to disable or
remove when a certain field is populated. The problem is, I can not find the
name of the control. I can get to the 'Format Control' window, but that's no
help. Where can I find the name of that control?

thanks

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
Disable and enable dropdown combobox(Form Control) Vinod[_2_] Excel Discussion (Misc queries) 0 November 6th 07 07:30 PM
How do I disable the ActiveX Control prompt? Keith Excel Discussion (Misc queries) 0 May 18th 05 09:58 AM
How to DISABLE THE CONTROL BREAK shortcut keys Marcello do Guzman Excel Programming 3 January 9th 04 01:48 PM
Disable control down (cntl D) on a worksheet mcpheat Excel Programming 1 September 17th 03 12:52 PM
Disable Control s Dave[_18_] Excel Programming 0 July 17th 03 05:59 PM


All times are GMT +1. The time now is 09:58 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"