Q:Importing an Excel file into a VB application

G

Geoff Jones

Hi

I have a question which I hope somebody can answer. I have written a VB
application with which I want to import an Excel file, analyze the data
within it and do some calculations. There are in fact five sheets in the
Excel file. My original idea was to import the file into access and create a
database file; which I did and worked beautifully. It generated five tables
in the database as expected.

However, I then thought why not bypass access and simply use a ODBC data
adaptor to the Excel file. I did this, using the Wizard, creating a new data
source using a (*.xls) driver, database version Excel 97-2000 (this may be
the problem because it may have been made in 2003), selected the workbook
(the Excel file) etc.

Everything seemed to go smoothly until it came to specify what data the data
adaptor loads into the dataset. For some reason, one of the sheets from the
spreadsheet did not appear in the Query builder section. This is puzzling
because when I imported the spreadsheet into Access, generated an access
database from it, loaded this database into the application I've written,
using exactly the same technique except for the datasource being an Access
driver, all five tables were obtained.

By the way, I'd prefer that any solution that is sent relies on the fact
that it is not necessarily the case that the client machines using the
application will have Access or Excel on their systems.

Can anybody suggest what may have gone wrong? Also, if you could direct me
to sites with details about importing and exporting data from Access/Excel
files I'd be most grateful.

Thanks in advance

Geoff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top