Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Tod" wrote in message ...
I have vbscripts that open a workbook, run it's Sub Main procedure, then close the workbook. Each workbook is using ADO to get data from a database. The basic code for the script looks like this: Set xl = CreateObject("Excel.Application") Set CurrentBook = xl.Workbooks.Open ("C:\MyPath\MyWorkbook.xls") xl.Run "Main" CurrentBook.Save CurrentBook.Close xl.Quit Set CurrentBook = Nothing Set xl = Nothing This works fine. However, two of the workbooks stay open in memory after the Sub Main has run. Are you allowing enough time for xl.Run "Main" to complete before executing CurrentBook.Save CurrentBook.Close ? -- |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Insert Object Problem | Excel Discussion (Misc queries) | |||
insert object problem | Excel Discussion (Misc queries) | |||
How to choose if I use a parameter or not in a parameter query | Excel Discussion (Misc queries) | |||
Problem with named range as VBA macro parameter | Excel Programming | |||
Object variable problem | Excel Programming |