Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Would I get this error if I was trying to fill a Listbox with values from a
collection and the collection was empty? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Post the code that is causing the error.
-- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Would I get this error if I was trying to fill a Listbox with values from a collection and the collection was empty? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub UserFormModelListDisplay_Initialize()
Dim mItem As Variant Load UserFormModelListDisplay For Each mItem In modelClass UserFormModelListDisplay.ListBox1.AddItem Item Next mItem UserFormModelListDisplay.Show End Sub "Chip Pearson" wrote: Post the code that is causing the error. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Would I get this error if I was trying to fill a Listbox with values from a collection and the collection was empty? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Shouldn't
UserFormModelListDisplay.ListBox1.AddItem Item be UserFormModelListDisplay.ListBox1.AddItem mItem -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Private Sub UserFormModelListDisplay_Initialize() Dim mItem As Variant Load UserFormModelListDisplay For Each mItem In modelClass UserFormModelListDisplay.ListBox1.AddItem Item Next mItem UserFormModelListDisplay.Show End Sub "Chip Pearson" wrote: Post the code that is causing the error. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Would I get this error if I was trying to fill a Listbox with values from a collection and the collection was empty? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am getting a type mismatch in that same line now. Thanks for catching that
little blunder. I appreciate any additional help. "Chip Pearson" wrote: Shouldn't UserFormModelListDisplay.ListBox1.AddItem Item be UserFormModelListDisplay.ListBox1.AddItem mItem -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Private Sub UserFormModelListDisplay_Initialize() Dim mItem As Variant Load UserFormModelListDisplay For Each mItem In modelClass UserFormModelListDisplay.ListBox1.AddItem Item Next mItem UserFormModelListDisplay.Show End Sub "Chip Pearson" wrote: Post the code that is causing the error. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Would I get this error if I was trying to fill a Listbox with values from a collection and the collection was empty? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What is modelClass a collection of? mItem is just an object within the
collection. You need to specify what exactly you want from the object. For example if modelClass is a collection of sheets then mItem is a sheet. You can't add a sheet to a list box but you can add it's name. If you want to add the sheet name then it should be mItem.Name -- HTH... Jim Thomlinson "Cody" wrote: I am getting a type mismatch in that same line now. Thanks for catching that little blunder. I appreciate any additional help. "Chip Pearson" wrote: Shouldn't UserFormModelListDisplay.ListBox1.AddItem Item be UserFormModelListDisplay.ListBox1.AddItem mItem -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Private Sub UserFormModelListDisplay_Initialize() Dim mItem As Variant Load UserFormModelListDisplay For Each mItem In modelClass UserFormModelListDisplay.ListBox1.AddItem Item Next mItem UserFormModelListDisplay.Show End Sub "Chip Pearson" wrote: Post the code that is causing the error. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Would I get this error if I was trying to fill a Listbox with values from a collection and the collection was empty? |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What data type is mItem?
-- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... I am getting a type mismatch in that same line now. Thanks for catching that little blunder. I appreciate any additional help. "Chip Pearson" wrote: Shouldn't UserFormModelListDisplay.ListBox1.AddItem Item be UserFormModelListDisplay.ListBox1.AddItem mItem -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Private Sub UserFormModelListDisplay_Initialize() Dim mItem As Variant Load UserFormModelListDisplay For Each mItem In modelClass UserFormModelListDisplay.ListBox1.AddItem Item Next mItem UserFormModelListDisplay.Show End Sub "Chip Pearson" wrote: Post the code that is causing the error. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Would I get this error if I was trying to fill a Listbox with values from a collection and the collection was empty? |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That was a big help. All I had to do was add .Model at the end of my mItem
to get the key property of my Collection. Question though, will I loose my collection when the file is closed or will the collection always remain as it is created? I reposted my problem with a complete explanation in Thread Collection Code. Thanks for your help!!! "Jim Thomlinson" wrote: What is modelClass a collection of? mItem is just an object within the collection. You need to specify what exactly you want from the object. For example if modelClass is a collection of sheets then mItem is a sheet. You can't add a sheet to a list box but you can add it's name. If you want to add the sheet name then it should be mItem.Name -- HTH... Jim Thomlinson "Cody" wrote: I am getting a type mismatch in that same line now. Thanks for catching that little blunder. I appreciate any additional help. "Chip Pearson" wrote: Shouldn't UserFormModelListDisplay.ListBox1.AddItem Item be UserFormModelListDisplay.ListBox1.AddItem mItem -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Private Sub UserFormModelListDisplay_Initialize() Dim mItem As Variant Load UserFormModelListDisplay For Each mItem In modelClass UserFormModelListDisplay.ListBox1.AddItem Item Next mItem UserFormModelListDisplay.Show End Sub "Chip Pearson" wrote: Post the code that is causing the error. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Would I get this error if I was trying to fill a Listbox with values from a collection and the collection was empty? |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim answered my question with mItem (being an object) was incomplete. I
needed to add .Model to get the correct property of the object. Thank you for your help. "Chip Pearson" wrote: What data type is mItem? -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... I am getting a type mismatch in that same line now. Thanks for catching that little blunder. I appreciate any additional help. "Chip Pearson" wrote: Shouldn't UserFormModelListDisplay.ListBox1.AddItem Item be UserFormModelListDisplay.ListBox1.AddItem mItem -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Private Sub UserFormModelListDisplay_Initialize() Dim mItem As Variant Load UserFormModelListDisplay For Each mItem In modelClass UserFormModelListDisplay.ListBox1.AddItem Item Next mItem UserFormModelListDisplay.Show End Sub "Chip Pearson" wrote: Post the code that is causing the error. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Would I get this error if I was trying to fill a Listbox with values from a collection and the collection was empty? |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You'll lose the collection object when the workbook is closed.
-- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... That was a big help. All I had to do was add .Model at the end of my mItem to get the key property of my Collection. Question though, will I loose my collection when the file is closed or will the collection always remain as it is created? I reposted my problem with a complete explanation in Thread Collection Code. Thanks for your help!!! "Jim Thomlinson" wrote: What is modelClass a collection of? mItem is just an object within the collection. You need to specify what exactly you want from the object. For example if modelClass is a collection of sheets then mItem is a sheet. You can't add a sheet to a list box but you can add it's name. If you want to add the sheet name then it should be mItem.Name -- HTH... Jim Thomlinson "Cody" wrote: I am getting a type mismatch in that same line now. Thanks for catching that little blunder. I appreciate any additional help. "Chip Pearson" wrote: Shouldn't UserFormModelListDisplay.ListBox1.AddItem Item be UserFormModelListDisplay.ListBox1.AddItem mItem -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Private Sub UserFormModelListDisplay_Initialize() Dim mItem As Variant Load UserFormModelListDisplay For Each mItem In modelClass UserFormModelListDisplay.ListBox1.AddItem Item Next mItem UserFormModelListDisplay.Show End Sub "Chip Pearson" wrote: Post the code that is causing the error. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Would I get this error if I was trying to fill a Listbox with values from a collection and the collection was empty? |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is it possible to store the collection in such a manner that I don't loose
it? Ever?? Thanks again "Chip Pearson" wrote: You'll lose the collection object when the workbook is closed. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... That was a big help. All I had to do was add .Model at the end of my mItem to get the key property of my Collection. Question though, will I loose my collection when the file is closed or will the collection always remain as it is created? I reposted my problem with a complete explanation in Thread Collection Code. Thanks for your help!!! "Jim Thomlinson" wrote: What is modelClass a collection of? mItem is just an object within the collection. You need to specify what exactly you want from the object. For example if modelClass is a collection of sheets then mItem is a sheet. You can't add a sheet to a list box but you can add it's name. If you want to add the sheet name then it should be mItem.Name -- HTH... Jim Thomlinson "Cody" wrote: I am getting a type mismatch in that same line now. Thanks for catching that little blunder. I appreciate any additional help. "Chip Pearson" wrote: Shouldn't UserFormModelListDisplay.ListBox1.AddItem Item be UserFormModelListDisplay.ListBox1.AddItem mItem -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Private Sub UserFormModelListDisplay_Initialize() Dim mItem As Variant Load UserFormModelListDisplay For Each mItem In modelClass UserFormModelListDisplay.ListBox1.AddItem Item Next mItem UserFormModelListDisplay.Show End Sub "Chip Pearson" wrote: Post the code that is causing the error. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Would I get this error if I was trying to fill a Listbox with values from a collection and the collection was empty? |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
No, all objects in memory are lost when the workbook is closed.
You could write out everything to a worksheet. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Is it possible to store the collection in such a manner that I don't loose it? Ever?? Thanks again "Chip Pearson" wrote: You'll lose the collection object when the workbook is closed. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... That was a big help. All I had to do was add .Model at the end of my mItem to get the key property of my Collection. Question though, will I loose my collection when the file is closed or will the collection always remain as it is created? I reposted my problem with a complete explanation in Thread Collection Code. Thanks for your help!!! "Jim Thomlinson" wrote: What is modelClass a collection of? mItem is just an object within the collection. You need to specify what exactly you want from the object. For example if modelClass is a collection of sheets then mItem is a sheet. You can't add a sheet to a list box but you can add it's name. If you want to add the sheet name then it should be mItem.Name -- HTH... Jim Thomlinson "Cody" wrote: I am getting a type mismatch in that same line now. Thanks for catching that little blunder. I appreciate any additional help. "Chip Pearson" wrote: Shouldn't UserFormModelListDisplay.ListBox1.AddItem Item be UserFormModelListDisplay.ListBox1.AddItem mItem -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Private Sub UserFormModelListDisplay_Initialize() Dim mItem As Variant Load UserFormModelListDisplay For Each mItem In modelClass UserFormModelListDisplay.ListBox1.AddItem Item Next mItem UserFormModelListDisplay.Show End Sub "Chip Pearson" wrote: Post the code that is causing the error. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Would I get this error if I was trying to fill a Listbox with values from a collection and the collection was empty? |
#13
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In order to keep the object you need to write the values to a sheet when the
program exits and read them back in the next time the program is started. There is no way to just save the object. -- HTH... Jim Thomlinson "Cody" wrote: Is it possible to store the collection in such a manner that I don't loose it? Ever?? Thanks again "Chip Pearson" wrote: You'll lose the collection object when the workbook is closed. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... That was a big help. All I had to do was add .Model at the end of my mItem to get the key property of my Collection. Question though, will I loose my collection when the file is closed or will the collection always remain as it is created? I reposted my problem with a complete explanation in Thread Collection Code. Thanks for your help!!! "Jim Thomlinson" wrote: What is modelClass a collection of? mItem is just an object within the collection. You need to specify what exactly you want from the object. For example if modelClass is a collection of sheets then mItem is a sheet. You can't add a sheet to a list box but you can add it's name. If you want to add the sheet name then it should be mItem.Name -- HTH... Jim Thomlinson "Cody" wrote: I am getting a type mismatch in that same line now. Thanks for catching that little blunder. I appreciate any additional help. "Chip Pearson" wrote: Shouldn't UserFormModelListDisplay.ListBox1.AddItem Item be UserFormModelListDisplay.ListBox1.AddItem mItem -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Private Sub UserFormModelListDisplay_Initialize() Dim mItem As Variant Load UserFormModelListDisplay For Each mItem In modelClass UserFormModelListDisplay.ListBox1.AddItem Item Next mItem UserFormModelListDisplay.Show End Sub "Chip Pearson" wrote: Post the code that is causing the error. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Would I get this error if I was trying to fill a Listbox with values from a collection and the collection was empty? |
#14
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you for your replies. I will work on the writing to the sheet now.
"Jim Thomlinson" wrote: In order to keep the object you need to write the values to a sheet when the program exits and read them back in the next time the program is started. There is no way to just save the object. -- HTH... Jim Thomlinson "Cody" wrote: Is it possible to store the collection in such a manner that I don't loose it? Ever?? Thanks again "Chip Pearson" wrote: You'll lose the collection object when the workbook is closed. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... That was a big help. All I had to do was add .Model at the end of my mItem to get the key property of my Collection. Question though, will I loose my collection when the file is closed or will the collection always remain as it is created? I reposted my problem with a complete explanation in Thread Collection Code. Thanks for your help!!! "Jim Thomlinson" wrote: What is modelClass a collection of? mItem is just an object within the collection. You need to specify what exactly you want from the object. For example if modelClass is a collection of sheets then mItem is a sheet. You can't add a sheet to a list box but you can add it's name. If you want to add the sheet name then it should be mItem.Name -- HTH... Jim Thomlinson "Cody" wrote: I am getting a type mismatch in that same line now. Thanks for catching that little blunder. I appreciate any additional help. "Chip Pearson" wrote: Shouldn't UserFormModelListDisplay.ListBox1.AddItem Item be UserFormModelListDisplay.ListBox1.AddItem mItem -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Private Sub UserFormModelListDisplay_Initialize() Dim mItem As Variant Load UserFormModelListDisplay For Each mItem In modelClass UserFormModelListDisplay.ListBox1.AddItem Item Next mItem UserFormModelListDisplay.Show End Sub "Chip Pearson" wrote: Post the code that is causing the error. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Would I get this error if I was trying to fill a Listbox with values from a collection and the collection was empty? |
#15
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Make the sheet xlVeryHidden so that no one accidentally (on purpose) goes in
and mucks it up for you. -- HTH... Jim Thomlinson "Cody" wrote: Thank you for your replies. I will work on the writing to the sheet now. "Jim Thomlinson" wrote: In order to keep the object you need to write the values to a sheet when the program exits and read them back in the next time the program is started. There is no way to just save the object. -- HTH... Jim Thomlinson "Cody" wrote: Is it possible to store the collection in such a manner that I don't loose it? Ever?? Thanks again "Chip Pearson" wrote: You'll lose the collection object when the workbook is closed. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... That was a big help. All I had to do was add .Model at the end of my mItem to get the key property of my Collection. Question though, will I loose my collection when the file is closed or will the collection always remain as it is created? I reposted my problem with a complete explanation in Thread Collection Code. Thanks for your help!!! "Jim Thomlinson" wrote: What is modelClass a collection of? mItem is just an object within the collection. You need to specify what exactly you want from the object. For example if modelClass is a collection of sheets then mItem is a sheet. You can't add a sheet to a list box but you can add it's name. If you want to add the sheet name then it should be mItem.Name -- HTH... Jim Thomlinson "Cody" wrote: I am getting a type mismatch in that same line now. Thanks for catching that little blunder. I appreciate any additional help. "Chip Pearson" wrote: Shouldn't UserFormModelListDisplay.ListBox1.AddItem Item be UserFormModelListDisplay.ListBox1.AddItem mItem -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Private Sub UserFormModelListDisplay_Initialize() Dim mItem As Variant Load UserFormModelListDisplay For Each mItem In modelClass UserFormModelListDisplay.ListBox1.AddItem Item Next mItem UserFormModelListDisplay.Show End Sub "Chip Pearson" wrote: Post the code that is causing the error. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Cody" wrote in message ... Would I get this error if I was trying to fill a Listbox with values from a collection and the collection was empty? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error: 424 Object required | Excel Programming | |||
Error 424 - Object Required | Excel Programming | |||
424 Object required error | Excel Programming | |||
Object Required Error | Excel Programming | |||
Syntax Error Runtime Error '424' Object Required | Excel Programming |