|
-
May 21st, 2004, 11:47 AM
#1
Thread Starter
Frenzied Member
Excel Reference
In my latest project I have the need to import data from an Excel workbook.
The thing is, I have Office 2003 loaded on my computer and I'm not sure what version will be loaded on my client's computers when they are running my software.
When I was looking at the Excel references, I noticed that there was one in there for 5.0 as well as 11.0.... Is the Excel 5.0 (library i guess) a standard one that is shipped with all versions of Office, or is this just a fluke?
Thanks,
Squirrelly1
Now happily married and still crankin' away at the keyboard.  Life is grand for a coder, no?
-
May 21st, 2004, 12:53 PM
#2
Hyperactive Member
Have you considered opening the workbook using ADO?
-
May 21st, 2004, 01:29 PM
#3
Thread Starter
Frenzied Member
This is what I am using...
VB Code:
Dim DS As System.Data.DataSet
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
Dim MyConnection As System.Data.OleDb.OleDbConnection
MyConnection = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0; data source=" & ofdOpen.FileName & "; Extended Properties=Excel 8.0;")
' Select the data from Sheet1 of the workbook.
MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]", MyConnection)
DS = New System.Data.DataSet
MyCommand.Fill(DS)
MyConnection.Close()
Now happily married and still crankin' away at the keyboard.  Life is grand for a coder, no?
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
|