I need to export data (a count report, so not a large number of rows) from SQL to Excel, which i’d usually use DTS for, but I need to be able to specify the filename and worksheet. I am looping through a table and running a report for each row in the table, so the first instance will create the spreadsheet and a named worksheet, and all further instances would add a new named worksheet.
As I wouldnt know where to start with passing parameters to DTS I thought i’d give VB a go, i.e. create a program and call it from SQL (which I do know how to do). However, exporting from SQL to Excel is proving more difficult than I thought it would.
Any help would be much appreciated.
Regards,
Phil