Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Populate a combobox list using excel 2000 data

Posted on 2004-09-01
2
145 Views
Last Modified: 2010-05-02
using an excel application object, how can you populate a combobox list using data that is specifically located in a maintained excel file?
0
Comment
Question by:japhet
2 Comments
 
LVL 2

Accepted Solution

by:
craigewens earned 50 total points
ID: 11950629
Private Sub Form_Load()

Dim ExcelSheet As Object
Set ExcelSheet = CreateObject("Excel.Sheet")
ExcelSheet.Application.Visible = True
ExcelSheet.Sheets("Sheet1").Cells(1, 1).Value = "Column 1, Row 1"
ExcelSheet.Sheets("Sheet1").Cells(2, 1).Value = "Column 1, Row 2"
ExcelSheet.Sheets("Sheet1").Cells(3, 1).Value = "Column 1, Row 3"
ExcelSheet.Sheets("Sheet1").Cells(4, 1).Value = "Column 1, Row 4"
ExcelSheet.Sheets("Sheet1").Cells(5, 1).Value = "Column 1, Row 5"
ExcelSheet.Sheets("Sheet1").Cells(6, 1).Value = "Column 1, Row 6"

For i = 1 To 6
    Combo1.AddItem ExcelSheet.Sheets("Sheet1").Cells(i, 1)
    DoEvents
Next i
Combo1.ListIndex = 0
ExcelSheet.Application.Quit
Set ExcelSheet = Nothing

End Sub
0
 

Author Comment

by:japhet
ID: 11970706
Thanks craigewens, I got the gist... =)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question