Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello guys,
I'm trying to fill various lists at the workbook_open event (at startup). This is what i have in the class named "Startup" Option Explicit Dim ws As Worksheet, rng As range, lst As ListObject Sub fillLists(rng) Set ws = Sheets("CODE") Set rng = ws.range(rng) Set lst = ws.ListObjects.Add(xlSrcRange, rng, , xlYes) End Sub And this is my code in the class "ThisWorkbook": Option Explicit Dim listRob As New Startup Private Sub Workbook_Open() listRob.fillLists ("A2:A8") End Sub The call to fillLists gives me the following error: "Error 1004". Application or Object-defined error What am i doing wrong here? Thanks in advance. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
All looks a bit skewy.
What is listRob? If it is a listbox somewhere, perhaps the code should be Private Sub Workbook_Open() listRob.List = Sheets("CODE").Range("A2:A8") End Sub -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Memento" wrote in message ... Hello guys, I'm trying to fill various lists at the workbook_open event (at startup). This is what i have in the class named "Startup" Option Explicit Dim ws As Worksheet, rng As range, lst As ListObject Sub fillLists(rng) Set ws = Sheets("CODE") Set rng = ws.range(rng) Set lst = ws.ListObjects.Add(xlSrcRange, rng, , xlYes) End Sub And this is my code in the class "ThisWorkbook": Option Explicit Dim listRob As New Startup Private Sub Workbook_Open() listRob.fillLists ("A2:A8") End Sub The call to fillLists gives me the following error: "Error 1004". Application or Object-defined error What am i doing wrong here? Thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Custom Text Lists copying, not filling | Excel Discussion (Misc queries) | |||
Multiple lists with repeated values for dependet drop down lists | Excel Worksheet Functions | |||
Filling out list based on other lists | Excel Discussion (Misc queries) | |||
filling information from one cell and filling another. | Excel Worksheet Functions | |||
Pulldowns or pick lists for filling cells. | Excel Programming |