R
RB Smissaert
Using Excel 2003.
Have a Userform with many controls.
When doing enabled = false for all commandbuttons and spinbuttons, the
command buttons get greyed out, but the spinbuttons are not.
The code is like this:
Sub DisableAllControls()
Dim ctl As MSForms.Control
For Each ctl In MainForm.Controls
If TypeOf ctl Is MSForms.CommandButton Or _
TypeOf ctl Is MSForms.SpinButton Then
ctl.Enabled = False
End If
Next
End Sub
But even when I just set one individual spinner the result is the same.
They are actually disabled, but they just keep showing as normal. I have
tried to correct this with DoEvents and Userform.Repaint and using the Sleep
API function, but to no avail.
Would there be any solution for this other than doing Visible = False?
When do exactly the same on a little demo form all is fine.
Thanks for any advice.
RBS
Have a Userform with many controls.
When doing enabled = false for all commandbuttons and spinbuttons, the
command buttons get greyed out, but the spinbuttons are not.
The code is like this:
Sub DisableAllControls()
Dim ctl As MSForms.Control
For Each ctl In MainForm.Controls
If TypeOf ctl Is MSForms.CommandButton Or _
TypeOf ctl Is MSForms.SpinButton Then
ctl.Enabled = False
End If
Next
End Sub
But even when I just set one individual spinner the result is the same.
They are actually disabled, but they just keep showing as normal. I have
tried to correct this with DoEvents and Userform.Repaint and using the Sleep
API function, but to no avail.
Would there be any solution for this other than doing Visible = False?
When do exactly the same on a little demo form all is fine.
Thanks for any advice.
RBS