Exporting Query Results to Excel File
Hello all,
I'm curious as to how to export a query to an excel worksheet.
I'm updating an old scheduling program we use to take a query (which grabs everyone's work schedules for the next month) and display it in a format similar to:
Name Day
Name1 D1
(For clarification, D1 is a code for "Daylight, 1 shift". Its the terminology we use)
We have a report already generated, however, when we export the report to excel, the formatting gets all FUBAR'd.
So my superior wants me to directly export the query results to an excel file, hoping that will preserve formatting better. I'm told there's two ways to do this -- one is to just dump data into an excel file, while the other involves moving from cell to cell inserting values. I'm interested in both methods, as I'm not sure which would work best and might have to try both.
Does anyone have a good starting point of code I could play with?
|