Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Getting a "File Not Found" error when trying to show userform | Excel Programming | |||
Cannot show, import, export userform: error &H80004005 / component is not corretly installed | Excel Programming | |||
Run time error on Userform Show | Excel Programming | |||
Userform.show '1004 Error' | Excel Programming | |||
show a userform | Excel Programming |