Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Code Fails to open UserForm

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

Ive worked with hundreds of different UserForms before; I cant figure it
out. Could the UserForm somehow get corrupted? This is the second time that
Ive 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---

--
RyGuy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Code Fails to open UserForm

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

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


On Dec 12, 12:23*pm, ryguy7272
wrote:
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---

--
RyGuy


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Code Fails to open UserForm

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...

--
RyGuy


"Susan" wrote:

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

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


On Dec 12, 12:23 pm, ryguy7272
wrote:
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

Ive worked with hundreds of different UserForms before; I cant figure it
out. Could the UserForm somehow get corrupted? This is the second time that
Ive 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---

--
RyGuy



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
scope of private function called from UserForm fails oscar.c.marin Excel Programming 1 October 20th 08 04:48 AM
Really strange!! Switch/Open code fails occasionaly?! Leanne M (Aussie) Excel Programming 4 May 2nd 08 12:56 PM
Workbooks.Open Fails Ed_P Excel Programming 3 September 27th 07 05:55 PM
workbooks.open function fails to open an existing excel file when used in ASP, but works in VB. san Excel Programming 1 January 3rd 06 03:22 AM
Autorefresh Fails on Open STEVE Excel Discussion (Misc queries) 0 December 20th 04 10:23 PM


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