Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Location: Sweden
Posts: 3
Default ListBox, error 424

Hi!

I´m trying to add items to a list box, using the following code:


Code:


ListBox1.Clear

While Not recordsetSales.EOF
ListBox1.AddItem (recordsetSales.Fields("product"))
recordsetSales.MoveNext
Wend


The problem is that I get 'Error 424: Object required', and I can´t figure out why.

Any help appreciated! Thanks!

Edit: I want this code to be executed when the Excel document opens, and have therfore out it in ThisWorkbook under the sub Workbook_Open(). If I use the same code on a CommandButton_click it works. Do I have to specify in which sheet the listbox is situated or something?

Last edited by coldmejl : June 14th 05 at 09:52 AM
  #2   Report Post  
Junior Member
 
Location: Sweden
Posts: 3
Default

Solved it! Thanks anyway!
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
Help! Activate worksheet from a listbox Bob Phillips Excel Worksheet Functions 0 May 18th 05 09:09 AM
Listbox Greg Brow New Users to Excel 2 February 18th 05 09:36 AM
Listbox or Combo advise Greg Brow Excel Worksheet Functions 1 February 16th 05 05:43 PM
How do I return the unique entries from a column to a listbox Dave Mc Excel Worksheet Functions 4 February 9th 05 08:02 AM
Inputbox with Listbox Jeff Excel Discussion (Misc queries) 3 December 22nd 04 05:54 PM


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