Code Fails to open UserForm

R

ryguy7272

I keep getting an error on a UserForm, named UserForm1. Microsoft Forms 2.0
is checked off as a Reference. The code is extremely simple:
Sub OpApp()
ActiveWindow.WindowState = xlMinimized
UserForm1.Show
End Sub

It keeps failing on this line:
UserForm1.Show

I’ve worked with hundreds of different UserForms before; I can’t figure it
out. Could the UserForm somehow get corrupted? This is the second time that
I’ve tried this; with a fresh UserForm. What could cause this kind of
behavior?

All code behind UserForm is commented out...
'Private Sub cmdNewPT_Click()
'Dim C As MSForms.Control
'For Each C In Me.Controls
'If TypeOf C Is MSForms.TextBox Then
'C.Text = ""
'End If
'Next C
'End Sub

Any thoughts?

Thanks,
Ryan---
 
S

Susan

Sub OpApp()
ActiveWindow.WindowState = xlMinimized
UserForm1.Show
End Sub

worked for me.....................
sorry!
susan
 
R

ryguy7272

Thanks for confirming Susan. I banged my head against the wall multiple
times. Then, I restarted my computer. Now it works fine! It must have been
the head banging that made it work...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top