Question : Problem using Active X Script Task in SQL 2005 SSIS designer

All,

I have the following vb script that parses correctly and while parsing performs the task correctly. The only problem is that when I try to execute the task it gives me an error  "Function not Found". Any help is greatly appreciated thanks !




Dim objExcel, SourceExcelFile, TemplateExcelFile, DestExcelFile, objsheetS,objsheetT, objSheetd

Set objExcel = CreateObject("Excel.Application")

SourceExcelFile = "C:\SystemReports\OpenSalesOrders\RPT_DailyDiscountsPerSeatKBPrivFilt.xls"
TemplateExcelFile = "C:\SystemReports\OpenSalesOrders\RPT_DailyDiscountsPerSeatKBPrivFilt.xls"

If len(cstr(Day(date)))=1 Then sDay="0"+ cstr(Day(date))
If len(cstr(Day(date)))=2 Then sDay=cstr(Day(date))
If len(cstr(Month(date)))=1 Then sMonth="0"+ cstr(Month(date))
If len(cstr(Month(date)))=2 Then sMonth=cstr(Month(date))
sYear=cstr(Year(date))

DestExcelFile = "C:\SystemReports\OpenSalesOrders\RPT_DailyDiscountsPerSeatKBPrivFilt"& sYear& sMonth& sDay&".xls"

objExcel.Workbooks.open SourceExcelFile
Set objSheets = objExcel.Sheets("Sheet1")
objSheets.Range("A2:AA65536").Copy
objExcel.Workbooks.Close

objExcel.Workbooks.open TemplateExcelFile
Set objSheetT = objExcel.Sheets("Sheet1")
objsheetT.range("A2").select
objsheett.paste
ObjsheetT.SaveAs (DestExcelFile)


Set objsheets = nothing
Set objsheett = nothing
Set objsheetd = nothing
set objexcel = nothing

Answer : Problem using Active X Script Task in SQL 2005 SSIS designer

PAQed with points refunded (250)

CetusMOD
Community Support Moderator
Random Solutions  
 
programming4us programming4us