LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default Problem with ADO with Parameter Object

"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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Object Problem Raj Excel Discussion (Misc queries) 1 April 20th 10 05:18 PM
insert object problem Jeremy Excel Discussion (Misc queries) 0 October 2nd 07 09:34 PM
How to choose if I use a parameter or not in a parameter query Arnaud Excel Discussion (Misc queries) 0 March 8th 07 01:19 PM
Problem with named range as VBA macro parameter Ken[_11_] Excel Programming 4 March 5th 04 02:16 PM
Object variable problem ExcelMonkey[_13_] Excel Programming 4 January 23rd 04 08:39 PM


All times are GMT +1. The time now is 04:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"