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