Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Export to Excel existing worksheet
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

127 Posts

Posted - 10/16/2006 :  11:37:04  Show Profile

I know how to export a table to excel, however I do not know how to export the data to my worksheet which is pretty much a template. In my worksheet I formatted the columns/rows and just need to insert the data via SQL. Can someone point me to a resource? I am already googleing and searching the forums.


Posting Yak Master

127 Posts

Posted - 10/16/2006 :  12:24:00  Show Profile
I know the DTS Wizard, however it does not let me remove the rows from excel. Basically my excel sheet contains several clumns, which are calculated based on the data placed inside the excel. Its basically a template which needs to be filled everytime. The DTS Export wizard appends the rows to my excel. Any ideas?
Go to Top of Page

Cybernetic Yak Master

11752 Posts

Posted - 10/17/2006 :  08:35:40  Show Profile  Visit spirit1's Homepage
the most viewed thread here:

Go with the flow & have fun! Else fight the flow
blog thingie:
Go to Top of Page

Yak Posting Veteran

88 Posts

Posted - 10/18/2006 :  12:53:22  Show Profile
I have a very similar proces in production right now. It also emails the results when finished. It's kind of a hack in my opinion, but works very well so far.

Instead of clearing the rows out before putting the new ones in, have a copy of the excel file with no rows in it. Then just cmdshell and copy that template to a new file and then use DTS to put the new rows in. The Excel DTS export adds the rows to the end of the file.

I have a trick to get the Active X commands easily to format the excel file afterwards. I can also post the code to email the results if needed. You will need to have Excel installed on the server.

Live to Throw
Throw to Live
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000