SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
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  

vishal_7
Posting Yak Master

127 Posts

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

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.

Thanks

vishal_7
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

spirit1
Cybernetic Yak Master

Slovenia
11750 Posts

Posted - 10/17/2006 :  08:35:40  Show Profile  Visit spirit1's Homepage
http://weblogs.sqlteam.com/mladenp/archive/2006/07/25/10771.aspx
or
the most viewed thread here:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

ws5926
Yak Posting Veteran

USA
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.05 seconds. Powered By: Snitz Forums 2000