Mike:
What you have to do is use Execute SQL Tasks to create your "tables"
(actually sheets) in the excel file. I usually drop the "tables" and
recreate with:
DROP TABLE [NAME]
GO
CREATE TABLE `NAME` (
`NAME_LAST` VarChar (20) ,
`NAME_SUFFIX` VarChar (10) ,
`NAME_FIRST` VarChar (25) ,
`NAME_MIDDLE` VarChar (15) ,
`ID` Long )
GO
Just have your "Existing Connection" set to your Microsoft Excel connection.
You may be able to do a DELETE FROM [NAME] to cleanup. I seem to recall
some caveat to the DELETE, but can't recall it right now. You can have no
file there, and the Microsoft Excel connection should create. If not, try
using an ActiveX script task and the
CreateObject("Scripting.FileSystemObject") to make a copy of your file
(either make a copy of a template you have ready or copy after you export
the data...multitasking being the deciding factor here) to the right
user/date.
Scott
[quoted text, click to view] "Mike Voissem" <MikeVoissem@discussions.microsoft.com> wrote in message
news:5BECD4BA-0E06-42DC-873C-3640066518E8@microsoft.com...
> Using DTS, we'd like to dump the data from a query to an Excel
> spreadsheet,
> and save it off with a user\date generated filename. We call the DTS from
> vb.net, and the problem is, DTS needs to have that spreadsheet present at
> all
> times or it breaks the transformation. What is the best way to do this?
> We
> tried clearing out all the cells in the spreadsheet before running the dts
> because we didn't want to append the data, and the dts fails because the
> "table" didn't exist. Anyone else run up against this problem?
> Mike
> --
> Mike Voissem
> Lead Software Engineer
> Donnelley Marketing