By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,264 Members | 1,220 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,264 IT Pros & Developers. It's quick & easy.

Q:Importing an Excel file into a VB application

P: n/a

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

Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Hi Geoff,

I have sended this link tomorrow by mistake to someone else, however it
should fits you.
Probably the most made mistake is giving the wrong sheet names.

(And do not use ODBC when not absolute needed anymore, that gives you in my
opinion only extra work)

I hope this helps?

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.