View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
MikeAllgood MikeAllgood is offline
external usenet poster
 
Posts: 6
Default Error saying Control object does not have Enable property.

I have a subroutine that accepts a Frame object as a parameter. I am trying
to cycle through the controls in the frame to set the enable properties of
the controls based on some criteria. Here is the subroutine:

Public Sub EnableObjects(ByRef fraEnable As Frame, ByRef myCheckBox As _
CheckBox)
Dim cCtl As Control

For Each cCtl In fraEnable.Controls
If cCtl.Name < myCheckBox.Name And TypeName(cCtl) < "Label" And _
cCtl.Name < "txtTalentMod1Total" Then
cCtl.enable = True <---Error happens here!
End If
Next cCtl
End Sub

When it get to the line,

cCtl.enable = True

I get an "Object doesn't support this property or method" error (Error 438).
Why would a control object not have an enable property? What am I doing wrong?

Thanks,
Mike