Solved

Populate a combobox list using excel 2000 data

Posted on 2004-09-01
2
140 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…

863 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now