General discussion

  • Creator
    Topic
  • #2290682

    DTS ActiveX Script

    Locked

    by paulkayengheng ·

    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?

    ‘**********************************************************************
    ‘ 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

All Comments

  • Author
    Replies
Viewing 0 reply threads