I am trying to export data from SQL Server into an Excel spreadsheet. I've got a DTS package that will dump the data into an existing spreadsheet, but I need to create the spreadsheet on the fly.
I've been able to find code that will create a text file and I found that if I name it as .xls, it will work. But I also need to add the column headings so I can dump data into it.
Here's the code I have for creating the file:
'Initialize file system object and file.
Dim fso
Dim a
'Create the text file.
Set fso = CreateObject("Scripting.FileSystemObject"
Set a = fso.CreateTextFile("C:\RPTS\gw_fallout.xls"
a.Close _________
Rott Paws
...It's not a bug. It's an undocumented feature!!!
I've been able to find code that will create a text file and I found that if I name it as .xls, it will work. But I also need to add the column headings so I can dump data into it.
Here's the code I have for creating the file:
'Initialize file system object and file.
Dim fso
Dim a
'Create the text file.
Set fso = CreateObject("Scripting.FileSystemObject"
Set a = fso.CreateTextFile("C:\RPTS\gw_fallout.xls"
a.Close _________
Rott Paws
...It's not a bug. It's an undocumented feature!!!