![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have created an active X task to open, refresh, and save an excel workbook prior to mailing it in a send mail task. When I execute the step, I get a dialog message that "This action will cancel a pending refresh command. Continue?" Even if I select OK, the workbook does not update, but the step completes successfully. Where does the pending refresh come from, and why does the update fail yet report success? Script below: '************************************************* ********************* ' Visual Basic ActiveX Script '************************************************* *********************** ' UpdateExcelWorkbook Option Explicit Function Main() Dim Excel_Application Dim Excel_WorkBook Dim sFilename sFilename = DTSGlobalVariables("gv_ExcelFileLocation").Value Set Excel_Application = CreateObject("Excel.Application") ' Open the workbook specified Set Excel_WorkBook = Excel_Application.Workbooks.Open(sFilename) Excel_WorkBook.RefreshAll Excel_WorkBook.Save 'Clean Up our Excel Objects Excel_WorkBook.Close Set Excel_WorkBook = Nothing Excel_Application.Quit Set Excel_Application = Nothing Main = DTSTaskExecResult_Success End Function Thanks in advance Fred |
![]() |
| Thread Tools | |
| Display Modes | |
| |