Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default UserForm.Show error

I have a series of userforms set up so when I click on the "Next" button on
one, it closes, and the next userform opens. While I was tweaking some of the
code, the userform.show command stopped working. When I click on "Next" I get
Run-Time Error 438: Object doesn't support this property or method. When I
click on debug, the line UserForm3.Show is highlighted.

Here is my code:
Private Sub cmdNext_Click()
' Do some stuff with the info on the form
Unload Me
UserForm3.Show
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default UserForm.Show error

Try switching the unload and show lines like:

Private Sub cmdNext_Click()
' Do some stuff with the info on the form
UserForm3.Show
Unload Me
End Sub




"Horatio J. Bilge, Jr." wrote:

I have a series of userforms set up so when I click on the "Next" button on
one, it closes, and the next userform opens. While I was tweaking some of the
code, the userform.show command stopped working. When I click on "Next" I get
Run-Time Error 438: Object doesn't support this property or method. When I
click on debug, the line UserForm3.Show is highlighted.

Here is my code:
Private Sub cmdNext_Click()
' Do some stuff with the info on the form
Unload Me
UserForm3.Show
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default UserForm.Show error

I tried that, but it didn't make any difference.


"JLGWhiz" wrote:

Try switching the unload and show lines like:

Private Sub cmdNext_Click()
' Do some stuff with the info on the form
UserForm3.Show
Unload Me
End Sub




"Horatio J. Bilge, Jr." wrote:

I have a series of userforms set up so when I click on the "Next" button on
one, it closes, and the next userform opens. While I was tweaking some of the
code, the userform.show command stopped working. When I click on "Next" I get
Run-Time Error 438: Object doesn't support this property or method. When I
click on debug, the line UserForm3.Show is highlighted.

Here is my code:
Private Sub cmdNext_Click()
' Do some stuff with the info on the form
Unload Me
UserForm3.Show
End Sub


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default UserForm.Show error

Okay, I feel stupid.
After lots more testing, I tracked it down to 2 If statements in the
UserForm_Initialize sub on UserForm3. I commented out each line one at a
time, and found that there was one line in each If statement that it didn't
like. I took one of the lines out, and it worked fine. I put the line back
in, and it still worked fine. I compared the line I added back in with the
other bad line that I still had commented out, and discovered that I spelled
"Bold" with an "F" (fold).

It's working good now.

"Horatio J. Bilge, Jr." wrote:

I have a series of userforms set up so when I click on the "Next" button on
one, it closes, and the next userform opens. While I was tweaking some of the
code, the userform.show command stopped working. When I click on "Next" I get
Run-Time Error 438: Object doesn't support this property or method. When I
click on debug, the line UserForm3.Show is highlighted.

Here is my code:
Private Sub cmdNext_Click()
' Do some stuff with the info on the form
Unload Me
UserForm3.Show
End Sub


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default UserForm.Show error

Glad you found it Horatio. The reason I suggested switching the two lines
was on the theory that like closing a workbook containing the code before the
procedure has completed will stop the code, I thought it might apply to the
UF as well. Since I always unload my UF from the parent procedure, I had
never had the problem.

"Horatio J. Bilge, Jr." wrote:

Okay, I feel stupid.
After lots more testing, I tracked it down to 2 If statements in the
UserForm_Initialize sub on UserForm3. I commented out each line one at a
time, and found that there was one line in each If statement that it didn't
like. I took one of the lines out, and it worked fine. I put the line back
in, and it still worked fine. I compared the line I added back in with the
other bad line that I still had commented out, and discovered that I spelled
"Bold" with an "F" (fold).

It's working good now.

"Horatio J. Bilge, Jr." wrote:

I have a series of userforms set up so when I click on the "Next" button on
one, it closes, and the next userform opens. While I was tweaking some of the
code, the userform.show command stopped working. When I click on "Next" I get
Run-Time Error 438: Object doesn't support this property or method. When I
click on debug, the line UserForm3.Show is highlighted.

Here is my code:
Private Sub cmdNext_Click()
' Do some stuff with the info on the form
Unload Me
UserForm3.Show
End Sub




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default UserForm.Show error

You could have saved yourself a great deal of time and effort by changing
the Error Handler setting in the Options dialog in the VBA editor from
"Break On Unhandled Errors" to "Break In Class Module". With the setting on
"Class Module", the debugger would have taken you directly to the offending
line of code rather than the Show statement, which loads the form into
memory (if necessary) and runs the Initialize event, and it is in the
Initialize event actually occurred.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"Horatio J. Bilge, Jr." wrote in
message ...
Okay, I feel stupid.
After lots more testing, I tracked it down to 2 If statements in the
UserForm_Initialize sub on UserForm3. I commented out each line one at a
time, and found that there was one line in each If statement that it
didn't
like. I took one of the lines out, and it worked fine. I put the line back
in, and it still worked fine. I compared the line I added back in with the
other bad line that I still had commented out, and discovered that I
spelled
"Bold" with an "F" (fold).

It's working good now.

"Horatio J. Bilge, Jr." wrote:

I have a series of userforms set up so when I click on the "Next" button
on
one, it closes, and the next userform opens. While I was tweaking some of
the
code, the userform.show command stopped working. When I click on "Next" I
get
Run-Time Error 438: Object doesn't support this property or method. When
I
click on debug, the line UserForm3.Show is highlighted.

Here is my code:
Private Sub cmdNext_Click()
' Do some stuff with the info on the form
Unload Me
UserForm3.Show
End Sub



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default UserForm.Show error

That's good to know. Thanks for the advice.


"Chip Pearson" wrote:

You could have saved yourself a great deal of time and effort by changing
the Error Handler setting in the Options dialog in the VBA editor from
"Break On Unhandled Errors" to "Break In Class Module". With the setting on
"Class Module", the debugger would have taken you directly to the offending
line of code rather than the Show statement, which loads the form into
memory (if necessary) and runs the Initialize event, and it is in the
Initialize event actually occurred.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"Horatio J. Bilge, Jr." wrote in
message ...
Okay, I feel stupid.
After lots more testing, I tracked it down to 2 If statements in the
UserForm_Initialize sub on UserForm3. I commented out each line one at a
time, and found that there was one line in each If statement that it
didn't
like. I took one of the lines out, and it worked fine. I put the line back
in, and it still worked fine. I compared the line I added back in with the
other bad line that I still had commented out, and discovered that I
spelled
"Bold" with an "F" (fold).

It's working good now.

"Horatio J. Bilge, Jr." wrote:

I have a series of userforms set up so when I click on the "Next" button
on
one, it closes, and the next userform opens. While I was tweaking some of
the
code, the userform.show command stopped working. When I click on "Next" I
get
Run-Time Error 438: Object doesn't support this property or method. When
I
click on debug, the line UserForm3.Show is highlighted.

Here is my code:
Private Sub cmdNext_Click()
' Do some stuff with the info on the form
Unload Me
UserForm3.Show
End Sub



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default UserForm.Show error

Maybe...

Private Sub cmdNext_Click()
' Do some stuff with the info on the form
me.hide
UserForm3.Show
Unload Me
End Sub

Make sure you didn't use UserForm3 as any other variable name, too.

Horatio J. Bilge, Jr. wrote:

I have a series of userforms set up so when I click on the "Next" button on
one, it closes, and the next userform opens. While I was tweaking some of the
code, the userform.show command stopped working. When I click on "Next" I get
Run-Time Error 438: Object doesn't support this property or method. When I
click on debug, the line UserForm3.Show is highlighted.

Here is my code:
Private Sub cmdNext_Click()
' Do some stuff with the info on the form
Unload Me
UserForm3.Show
End Sub


--

Dave Peterson
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
Getting a "File Not Found" error when trying to show userform Bruce[_2_] Excel Programming 1 June 7th 07 08:30 PM
Cannot show, import, export userform: error &H80004005 / component is not corretly installed danieldc Excel Programming 2 November 25th 05 12:59 PM
Run time error on Userform Show DonF Excel Programming 2 November 23rd 05 09:56 PM
Userform.show '1004 Error' Stan Excel Programming 2 August 9th 04 11:12 PM
show a userform Joe[_17_] Excel Programming 0 July 18th 03 03:25 PM


All times are GMT +1. The time now is 03:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"