Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default My program uses up resources

I have a VB6 program that uses Excel 9.0 object model. It
looks like this

set x = Excel.Application
for i = 1 to 500
set b = x.workbooks.open (...)
set s = b.worksheets(...)
[Process "s"]
call b.Close
next i
call x.quit

This causes my PC to freeze with the message "Resources
are dangerously low" (or something like that). I figured
Excel leaves garbage behind when a book is opened and
closed, so I did this:

for i = 1 to 500
set x = Excel.Application
set b = x.workbooks.open (...)
set s = b.worksheets(...)
[Process "s"]
call b.Close
call x.Quit
Next i

I assumed that closing Excel after each book would force
the OS (Win 98) to clean up the garbage, but the computer
freezes.

Any ideas?

Dom
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default My program uses up resources

There is some clean up you have to do...

set x = nothing
set b = nothing
set s = nothing

...but this will not improve the speed or efficiency. I just ra
through your second block of code and it seems reasonable enough to do
however, I have no clue what process "s" is, which is where I suspec
your problem lies. Try commenting out the call to process "s" to see i
that is where the problem is

--
Message posted from http://www.ExcelForum.com

Reply
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
Not Enough Resources V_Ernst Excel Discussion (Misc queries) 2 December 9th 08 07:04 PM
not enough resources! please help alexis Excel Discussion (Misc queries) 2 May 23rd 08 11:25 PM
no resources sue Links and Linking in Excel 0 July 29th 06 10:22 PM
Available Resources Katherine Excel Discussion (Misc queries) 0 May 10th 05 07:11 PM
merging excel program with tdc finance program judy Excel Programming 0 November 5th 03 08:01 PM


All times are GMT +1. The time now is 06:51 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"