Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Text File Import into Excel ?

Status
Not open for further replies.

Lemox

Programmer
Dec 13, 2003
67
GB
Hi,

I'm looking for a method to import text files into Excel.
Here is the way I would like it to work :

1) Execute a SQL query that produces a structured text file containing the data.

2) Import this text file into Excel (without any wizard).

3) Produce charts (in a first time, this could be done by the user himself into Excel)

Individually, these steps don't seem so difficult but...
In order to facilitate further development, I would like my code to be able to process SQL DYNAMICALLY.
I mean, if the user wants to add new parameters in the Excel charts, it could be great to change ONLY the SQL query and let the application process all the columns returned by the quesry.

Is this easily feasable ?

This is the first time I use VB with Excel : I'm not asking for 'all-done-ready-to-run' code (well, even if pieces of code are often useful... :) ), just ideas or links to something like that.

Thanks in advance.
Lemox
 
Lemox,

1) Execute a SQL query that produces a structured text file containing the data.

2) Import this text file into Excel (without any wizard).

Use Date/Get External Data/SQL Files - your SQL database - Your Table.....

CAVEAT: You must have an ODBC driver loaded for SQL Databases.

Skip,

[glasses] [red]Be advised:[/red] When transmitting sheet music...
If it ain't baroque, don't fax it! [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top