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

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Worksheet in Excel

Author  Topic 

ramdas
Posting Yak Master

181 Posts

Posted - 2004-03-15 : 14:08:51
Hi,
Using VB script in the activexscript task, is it possible to create a worksheet with in a excel spreadsheet. The excel spreadsheet will be a new file for every week, so in the activexscript task the datasource is set dynamically. for ex:

oConn.DataSource = "C:\Work\Projects\data_extract"+"_"+Cstr(Year(date))+CStr(Month(date))+CStr(Day(Date))+".xls"

After this is done, is it possible to create the worksheet.
Thank you

Ramdas Narayanan
SQL Server DBA

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2004-03-25 : 22:09:52
Ramdas,

You'll need to use the Excel object model to manipulate the XLS files.
something like:
set xl = CreateObject("Excel.Application")
set xls = xl.Workbook.Add(your workbook name)
set wsht = xls.Worksheets.Add(new worksheet name)

Can't be sure of the syntax, but check the MSDN doco

Go to Top of Page
   

- Advertisement -