Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Run time error on Userform Show

I have a simple app - one userform that I call from a command button on the
spreadsheet.
A couple of times - I run into an error message when trying to show the
userform. Either a subscript out of range (I am not using subscripts) or a
type mismatch error.
I try renaming the form - no good. I try loading it then showing it - still
no good.

I got the following off of the website here - I named the form UserForm1
(very original I admit) - as soon as it gets to the load UserForm1 I get the
subscript error. I have used other names - renamed the form - nothing works.

I have run into this a couple of times before - Excel gets into a funk and
will not recognize the form. The funny thing is that the code will work
during the early stages of development - then I add a few more items to the
form and it gets into this run time error thing.

The MS website info addresses collections of userforms and getting this
error - but I have only a single form I am trying to display.

Any help is greatly appreciated - I tried all 3 of the "workarounds" as
suggested on the MS website and none of them worked.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default Run time error on Userform Show

Don

Error 9 'Subscript out of range' means that you are referring to an item in
a collection (Your one form in the forms collection) that does not exist.
So for example, if you had line

UserForm1.Show

where there was no form called UserForm1 you will get this error

Check your code is referring to the same 'name' as in the (Name) setting in
the properties dialog. The caption (Name at the top of the form is
irrelevant in this case)

One your worksheet button, make sure the TakeFocusOnClick property is set to
false and check the types you have declared any variables at, as a type
mismatch is that something is returning a value (type) which is not expected
--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
HIS


"DonF" wrote in message
...
I have a simple app - one userform that I call from a command button on the
spreadsheet.
A couple of times - I run into an error message when trying to show the
userform. Either a subscript out of range (I am not using subscripts) or
a
type mismatch error.
I try renaming the form - no good. I try loading it then showing it -
still
no good.

I got the following off of the website here - I named the form UserForm1
(very original I admit) - as soon as it gets to the load UserForm1 I get
the
subscript error. I have used other names - renamed the form - nothing
works.

I have run into this a couple of times before - Excel gets into a funk and
will not recognize the form. The funny thing is that the code will work
during the early stages of development - then I add a few more items to
the
form and it gets into this run time error thing.

The MS website info addresses collections of userforms and getting this
error - but I have only a single form I am trying to display.

Any help is greatly appreciated - I tried all 3 of the "workarounds" as
suggested on the MS website and none of them worked.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Run time error on Userform Show

I would first rule out something on the form that might be botched during
the load event. You say the form works for a while and then you add more
items and it happens....so it sounds like it's one of the controls or the
data getting loaded into them. If you remove all of the controls and all of
the code behind, then load the form, does it load?

To narrow down the problem, remove each control one-by-one and try to load
the form.



"DonF" wrote in message
...
I have a simple app - one userform that I call from a command button on

the
spreadsheet.
A couple of times - I run into an error message when trying to show the
userform. Either a subscript out of range (I am not using subscripts) or

a
type mismatch error.
I try renaming the form - no good. I try loading it then showing it -

still
no good.

I got the following off of the website here - I named the form UserForm1
(very original I admit) - as soon as it gets to the load UserForm1 I get

the
subscript error. I have used other names - renamed the form - nothing

works.

I have run into this a couple of times before - Excel gets into a funk and
will not recognize the form. The funny thing is that the code will work
during the early stages of development - then I add a few more items to

the
form and it gets into this run time error thing.

The MS website info addresses collections of userforms and getting this
error - but I have only a single form I am trying to display.

Any help is greatly appreciated - I tried all 3 of the "workarounds" as
suggested on the MS website and none of them worked.



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
Cannot show, import, export userform: error &H80004005 / component is not corretly installed danieldc Excel Programming 2 November 25th 05 12:59 PM
Userform.show '1004 Error' Stan Excel Programming 2 August 9th 04 11:12 PM
How to Show a userform from XLA sub Thibault Excel Programming 1 December 8th 03 03:36 PM
"Can't Show Modally" - Run-Time Error '400' Problem Bruce B[_2_] Excel Programming 3 July 14th 03 02:01 PM


All times are GMT +1. The time now is 01:16 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"