I am trying to check all command button in a user form for enabled state and if state is false then enabling it. I have tried this code but runs without error but changes nothing where I manually disable button. It suppose to enable them. Would you please check the code. I get the code from this page https://stackoverflow.com/questions/49050223/vba-loop-through-buttons-on-userform
Sub form_reset()
Dim ctrl1 As Control
For Each ctrl1 In frmview.Controls
If TypeName(ctrl1) = "commandbutton" Then
Dim cmdbtn As CommandButton
Set cmdbtn = ctrl
If cmdbtn.Enabled = False Then
cmdbtn.Enabled = True
End If
End If
Next
frmview.Show