General discussion
-
Topic
-
DTS ActiveX Script
LockedI have a DTS ActiveX Script, which I open a excel spreadsheet to Update.
It was running fine all the while, until the last 2 days. It ran for over an hours and still not finished. This package usually runs for around 6 to 7 mins the max.
I enclose the codes below. How can I check what has got wrong?
‘**********************************************************************
‘ Visual Basic ActiveX Script
‘************************************************************************Function Main()
‘on error resume nextdim File_name
dim Macro_name
dim ExcelObject‘Put Speardsheet name that you want to open
File_name=”\\E204111S20\TRisk_Data\TRISK_PL\DAILY_COF_WOF.xls”
‘Put Macro name that you want to run
Macro_name=”Update”
‘Do you want to save your workbook
Save_Flag=TrueSet ExcelObject=Createobject(“Excel.application”)
ExcelObject.Workbooks.Open File_name
ExcelObject.Run (macro_name)
if Save_Flag then
ExcelObject.Workbooks(1).Save
Else
ExcelObject.Workbooks(1).Close (Save_Flag)
End ifif err.number<>0 then
ExcelObject.Workbooks(1).Close (False)
End if
ExcelObject.Application.Quit
Set ExcelObject=nothing
Main = DTSTaskExecResult_SuccessEnd Function