Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default unload Me compile error

I have a UserForm that is loaded by an Worksheet_SelectionChange event.
Since the listboxes in the form are loaded with relative values, I want to
unload the form when either the OK or Cancel button is clicked.

I've tried both "unload me" and "unload frm_spread" in the button click
events. When I input this into the code, "me" is updated to "Me" or
"frm_spread" is updated to "frm_Spread"; "unload" remains "unload" (it isn't
capitalized)

When I run the code, I get:
Compile error - wrong number of arguments or invalid property assignment.

I'm running excel 2007.

Thanks in advance for any help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default unload Me compile error

Since the code is behind the userform, you can use "UnLoad Me".

To get the capitalization correct (which doesn't really matter to excel/VBA),
you can do:

type this on a blank line in your code:
dim UnLoad
(and hit enter)
then delete this line

=========
But....

You have a different problem. You have a sub or a function in your code that is
named unload (all lower case). You'll want to change the name of that procedure
and then adjust all the lines that call that procedure.



Cinque Terra wrote:

I have a UserForm that is loaded by an Worksheet_SelectionChange event.
Since the listboxes in the form are loaded with relative values, I want to
unload the form when either the OK or Cancel button is clicked.

I've tried both "unload me" and "unload frm_spread" in the button click
events. When I input this into the code, "me" is updated to "Me" or
"frm_spread" is updated to "frm_Spread"; "unload" remains "unload" (it isn't
capitalized)

When I run the code, I get:
Compile error - wrong number of arguments or invalid property assignment.

I'm running excel 2007.

Thanks in advance for any help.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default unload Me compile error

It would help if you posted your code.
--
HTH,
Barb Reinhardt



"Cinque Terra" wrote:

I have a UserForm that is loaded by an Worksheet_SelectionChange event.
Since the listboxes in the form are loaded with relative values, I want to
unload the form when either the OK or Cancel button is clicked.

I've tried both "unload me" and "unload frm_spread" in the button click
events. When I input this into the code, "me" is updated to "Me" or
"frm_spread" is updated to "frm_Spread"; "unload" remains "unload" (it isn't
capitalized)

When I run the code, I get:
Compile error - wrong number of arguments or invalid property assignment.

I'm running excel 2007.

Thanks in advance for any help.

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
Getting error with load/unload of UserForms?? Ed from AZ Excel Programming 2 August 22nd 07 04:21 PM
help with this error-Compile error: cant find project or library JackR Excel Discussion (Misc queries) 2 June 10th 06 09:09 PM
VBAProject name compile error, not defined at compile time Matthew Dodds Excel Programming 1 December 13th 05 07:17 PM
How do I get rid of "Compile error in hidden module" error message David Excel Discussion (Misc queries) 4 January 21st 05 11:39 PM


All times are GMT +1. The time now is 02:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"