Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create Excelfile of a template 1

Status
Not open for further replies.

Sanni1

Programmer
Feb 3, 2005
4
DE
I have to export data in a excel file which has a special layout for an other system.

The result excel file should have in the first row the header of the second data row. The second row contains sums.

In the third row is another header row. The rows belows contains the data.

I would like to use an excel template an fill the file below third row.
 
Thanks

I will test this suggestion.
 
Now i can create a excel file with Active X in DTS. But i have still the problem, that the output to excel should start in the thrird row.
 
putting your results on the 3rd row will be a little more difficult. Have you considered moving your results to a seperate sheet and updating the formula's to look at the seperate sheet. This would be the easiest solution.

Another possibility is to go the other direction. Code in VBA for excel to pull from the SQL server and display the results in the spreadsheet. This can be done using ADO and the offset object of VBA

A third possiblity would be to use a hybrid of what you have and ADO. And where you open the sheet through DTS make a ADO connection fill the sheet and then save the spreadsheet, close and you are done.

Hope this helps.

Jon
 
I will use another ActiveX script, which moves the data two row below. Than i set the other values.

With my question i wanted to prevent, that there is a simple solution i don't know.

Ulrich
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top