Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default User Form Crashing Excel

I have a user form that has three diffferent drop boxes, as well as multiple
check boxes on it. I have altered the way that I load the combo boxes
numerous times to make sure that they load correctly, such as:

Combobox1.rowsource = ShtLists.range("List1).values
Combobox1.RowSource =
ThisWorkbook.Sheets("TheLists").Range("g3:g4").Add ress(external:=True)

The problem is that even when they appear to load and operate correctly if,
(once I am back on the Excel page) if I close the file without saving Excel
aborts. This only happens if I have opened the user form and selected one of
the combo boxes.

I have named ranges that contain these lists and have named the sheets as
well, such that the list I want to load in ComboBox1 is really on sheet
"ShtLists" in range "List1", so usually I would reference as
shtlists.range("List1"). I have reverted back to Sheet Names and cell
references to try and eliminate any of the object problems I have read about.

I really need to know the cleanest way to load these drop boxes and if I
need to clean them out before closing the form.

Thank you in advance for any help.






  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default User Form Crashing Excel

It is not what is in the combobox that causes the error. It is most likely
the code to load the data in the combobox or the event code that executes
when the control is clicked.

For instance:

Combobox1.rowsource = ShtLists.range("List1).values

This code will not work because the row source has to be in A1 notation, not
values. The result of any code that you use has to equate to one of these
two formats:

Sheet1!a1:d10 or a1:d10

The Sheet reference must be used when the row source is not on the active
sheet.



"Troubled User" wrote:

I have a user form that has three diffferent drop boxes, as well as multiple
check boxes on it. I have altered the way that I load the combo boxes
numerous times to make sure that they load correctly, such as:

Combobox1.rowsource = ShtLists.range("List1).values
Combobox1.RowSource =
ThisWorkbook.Sheets("TheLists").Range("g3:g4").Add ress(external:=True)

The problem is that even when they appear to load and operate correctly if,
(once I am back on the Excel page) if I close the file without saving Excel
aborts. This only happens if I have opened the user form and selected one of
the combo boxes.

I have named ranges that contain these lists and have named the sheets as
well, such that the list I want to load in ComboBox1 is really on sheet
"ShtLists" in range "List1", so usually I would reference as
shtlists.range("List1"). I have reverted back to Sheet Names and cell
references to try and eliminate any of the object problems I have read about.

I really need to know the cleanest way to load these drop boxes and if I
need to clean them out before closing the form.

Thank you in advance for any help.






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default User Form Crashing Excel

Do I have to reference the sheet as Sheet1! or can I use the named sheet
names such as sht1?

What about checkboxes, can they reference named ranges?

On the save of the file it also turn the left side of the screen blue, if
that is any help.

Thanks,


"JLGWhiz" wrote:

It is not what is in the combobox that causes the error. It is most likely
the code to load the data in the combobox or the event code that executes
when the control is clicked.

For instance:

Combobox1.rowsource = ShtLists.range("List1).values

This code will not work because the row source has to be in A1 notation, not
values. The result of any code that you use has to equate to one of these
two formats:

Sheet1!a1:d10 or a1:d10

The Sheet reference must be used when the row source is not on the active
sheet.



"Troubled User" wrote:

I have a user form that has three diffferent drop boxes, as well as multiple
check boxes on it. I have altered the way that I load the combo boxes
numerous times to make sure that they load correctly, such as:

Combobox1.rowsource = ShtLists.range("List1).values
Combobox1.RowSource =
ThisWorkbook.Sheets("TheLists").Range("g3:g4").Add ress(external:=True)

The problem is that even when they appear to load and operate correctly if,
(once I am back on the Excel page) if I close the file without saving Excel
aborts. This only happens if I have opened the user form and selected one of
the combo boxes.

I have named ranges that contain these lists and have named the sheets as
well, such that the list I want to load in ComboBox1 is really on sheet
"ShtLists" in range "List1", so usually I would reference as
shtlists.range("List1"). I have reverted back to Sheet Names and cell
references to try and eliminate any of the object problems I have read about.

I really need to know the cleanest way to load these drop boxes and if I
need to clean them out before closing the form.

Thank you 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
Excel User Form MG Excel Worksheet Functions 0 February 25th 09 12:58 AM
Date field in user form & Loading a user form on opening workbook Balan Excel Programming 1 May 24th 08 03:40 PM
Excel 2003 crashing everytime user goes to save document. R1 Psycho Setting up and Configuration of Excel 6 September 11th 07 07:10 PM
Problem with Excel crashing when opening an user form James Excel Programming 0 July 18th 06 10:39 PM
How to: User Form to assign a user defined range to a macro variab TrevTrav Excel Programming 1 March 22nd 05 07:57 PM


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