Userforms help

  • Thread starter Thread starter ganesh.valakati
  • Start date Start date
G

ganesh.valakati

i have created an excel userform to hold and extract data. Im now in
the modst of converting this modeule into an addin. However Im running
into problems while referencing the userforms.

I keep on getting the run time error 9. The error message is
"Subscript out of range"

I have a userform named "Defaults". the below sample code has 3 Text
boxes and they pick yup values from a worksheet inside the addin.
While I believe I can reference the worksheets using "This workbook".
how do I reference the userform.. I have referenced the VBA
Extensibility 5.3 in Available references

Sample code


Defaults.TBFCC.Value = Sheets("Default Values").Range("B54").Value
Defaults.TBMakerID.Value = Sheets("Default Values").Range("B81").Value
Defaults.TBEffectiveDt.Value = Sheets("Default
Values").Range("B82").Value
 
i have created an excel userform to hold and extract data. Im now in
the modst of converting this modeule into an addin. However Im running
into problems while referencing the userforms.

This newsgroup is devoted to Microsoft Access, the database product. Try posting your message in a newsgroup devoted to
Excel like microsoft.public.excel or microsoft.public.excel.programming,
I keep on getting the run time error 9. The error message is
"Subscript out of range"

I have a userform named "Defaults". the below sample code has 3 Text
boxes and they pick yup values from a worksheet inside the addin.
While I believe I can reference the worksheets using "This workbook".
how do I reference the userform.. I have referenced the VBA
Extensibility 5.3 in Available references

Sample code


Defaults.TBFCC.Value = Sheets("Default Values").Range("B54").Value
Defaults.TBMakerID.Value = Sheets("Default Values").Range("B81").Value
Defaults.TBEffectiveDt.Value = Sheets("Default
Values").Range("B82").Value

If you're getting a "Subscript out of Range" error, this generally means that you're not referencing something correctly
.... basically, it means that you're trying to reference Range("B54") (or something) and the highest available number is
LESS than that ... this is very basic, of course, but should put you on the right path.

Also, step through your code line-by-line and determine EXACTLY which line is giving your the error ... often after
doing that, the cause is very apparent.

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 
Back
Top