I 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?
'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=True
Set 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 if
if err.number<>0 then ExcelObject.Workbooks(1).Close (False) End if ExcelObject.Application.Quit Set ExcelObject=nothing Main = DTSTaskExecResult_Success
End Function
This conversation is currently closed to new comments.
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
DTS ActiveX Script
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 next
dim 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=True
Set 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 if
if err.number<>0 then
ExcelObject.Workbooks(1).Close (False)
End if
ExcelObject.Application.Quit
Set ExcelObject=nothing
Main = DTSTaskExecResult_Success
End Function