Click to See Complete Forum and Search --> : How to export contents of a recordset to an Excell Sheet?


Raptors Fan
April 7th, 2001, 10:11 PM
Hi everyone,

I need to know how one goes about opening Excell, writing data to an Excell sheet, and saving it.

Your help is much appreciated... Thank You!

kconcept
April 8th, 2001, 07:31 AM
If you dont need any special formatting just write the recordset to a comma delimited file and save it as file.csv. This will reduce the overhead of having to use the excel object model.

Just make sure that if any of the data is character make sure you put [""] around it.

The output file would look like:

col1, col2, "col3"

etc...

Kev.-

coolbiz
April 8th, 2001, 11:40 AM
Not sure what is the implementation of your program. Another way of retrieving data from DB into Excel is to use the QUERY tool in Excel.

In Excel 2000: Data->Get External Data->New Query which will allow you to query your DB directly from Excel and display the contents.

Otherwise, comma-delimited file is the easiest way to go.

-Cool Bizs

Raptors Fan
April 8th, 2001, 08:33 PM
Thanks guys, your tips really helped.