Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a VBS script that runs each night. It is supposed to open an
Excel document so that it's start macros run and do some preprocessing. It appears that I am terminating the application before the macros get a chance to run. Is there a flag I can check to see if they are still processing before I exit the application? Thank you Here is the code I am using. It is quite short, most of the code is for troubleshooting purposes... ======================== On Error Resume Next Set oExcel = CreateObject("Excel.application") Set oFSO = CreateObject("Scripting.FileSystemObject") Set oTS = oFSO.OpenTextFile("autodialer_cube.log", 2, True) oTS.WriteLine Now & " Opening workbook..." oExcel.Workbooks.Open "\\CASK\groups\AutoDialer\AutoDialer.xls" oExcel.ActiveWorkbook.RunAutoMacros 1 oExcel.ActiveWorkbook.Saved = True oTS.WriteLine oExcel.ActiveWorkbook.Worksheets(1).Cells(5, 1).Value If Err.Number < 0 Then oTS.WriteLine Now & " (" & Err.Number & ") " & Err.Description Err.Clear End If oTS.WriteLine Now & " Closing workbook..." oExcel.Quit If Err.Number < 0 Then oTS.WriteLine Now & " (" & Err.Number & ") " & Err.Description Err.Clear End If ======================== |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
A complete novice guide to excell which course is best to start | New Users to Excel | |||
excel.exe is not terminating from task manager | Excel Programming | |||
Ensuring Macros are running | Excel Programming | |||
How can I complete a spreadsheet using macros? | Excel Discussion (Misc queries) |