Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Runtime Error 9

  Asked By: Leon    Date: Nov 13    Category: MS Office    Views: 713
  

I'm sure you've all seen this particular error many times, but this
time I am just baffled as to what is going on.

I have a pretty big userform that is activated by clicking a command
button. In the previous version of the spreadsheet, I had no problems,
now that I've added another 35 variables to deal with (bringing the
total to 81), and assigned them each a brand new text box, my macro
craps out at "fmProjectLog.Show":

Private Sub CommandButton1_Click()
fmProjectLog.Show
End Sub

I've checked my spelling for the most part, and I believe I'm okay.
Does anyone have any idea what might be going on here? Please let me
know if you need to see any additional code. Thanks!

Share: 

 

3 Answers Found

 
Answer #1    Answered By: Oscar Evans     Answered On: Nov 13

Can you run the form from the VBE using F5? If not what error  do you get?

 
Answer #2    Answered By: Michael Evans     Answered On: Nov 13

runtime  error of 9 suggests an "out of range error". This could be that
you are initializing an array somewhere in your code  with the adittional
new variables. I guess the error  lies here and not in the spelling. Check
your array dimensions.

 
Answer #3    Answered By: Woodrow Jones     Answered On: Nov 13

Thanks a lot for your input, I actually figured it out myself after
80 cups of coffee, and some hair pulling. Just in case someone else
has a similiar problem, I'll show  you what I found to be wrong.

The error  was showing up in the fmProjectLog.show line, and, it
turned out the real error was in the initialization of the userform,
which was initializing "UserForm" instead of "fmProjectLog".

This is something I really should've caught quite a bit earlier, I
feel kind of like a big  ditz, thank you guys so much for your help!

 
Didn't find what you were looking for? Find more on Runtime Error 9 Or get search suggestion and latest updates.




Tagged: