|
-
Jul 13th, 2004, 11:13 AM
#1
Thread Starter
Hyperactive Member
Import Results from Excel File [VB6]
Given the following:
- A form [frmMain] with 3 textboxes [txt1, txt2, and txt3]
- An Excel File (text.xls) with 2 rows and 3 columns that looks like the following
NAME ID TYPE
Jon 01 Active
I need a way to import the results from the Excel file into the Textboxes.
Row[0] is only headers (Name, ID, and Type) so Row[1] holds the actual data I need to retrieve.
Currently I have the following written up (load the excel file and open it):
Dim oExcel As Object
Dim oBook As Object
Dim oSheet As Object
Set oExcel = CreateObject("Excel.Application")
Set oBook = oExcel.Workbooks.Open(c:\test.xls, true)
With oBook.Sheets(1)
.Activate
… now what? ….
Any clues?
I need a way to take those results from the Sheet and place them in the appropriate text boxes.
Of course this is very generalized, in reality there are many rows and much more columns however this will serve as a great starting point for me.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|