|
-
Feb 22nd, 2004, 02:59 PM
#1
Thread Starter
New Member
Out Of Memory Vba problem
Hi.
My Pc is PIII 866Mhz 256Mb ram 40Gb HD
under windows ME and office 2000
I have excel file with big Vba macro this run fine, now I create another option to my macro , when run this option open another excel file with auto_open macros at this time I obtain "Out of Memory" windows message, how can I solve this problem?
Thanks in advance.
asihuay
-
Feb 23rd, 2004, 10:12 AM
#2
Addicted Member
You do not say how big both files are.
256 mb. RAM may not be enough to hold them both in memory.
Regards
BrianB
-------------------------------
-
Feb 23rd, 2004, 09:28 PM
#3
Thread Starter
New Member
Hi. BrianB
The files are about 1.4 mb , I do not thing the problem is in the sistem ram ,I think is the excel way to manage memory, anything occur when run code to open workbook with workbook_open event I want know how solve this.
Thanks in advance.
-
Feb 25th, 2004, 04:17 AM
#4
Are you properly closing and setting your object variables to nothing throughout your code at the earliest opportunity
-
Feb 25th, 2004, 07:01 AM
#5
Banned
Please destroy the object after using
set excel.sheet = nothing
it relase the space
if not then incrses you virtual memory
and clean the even viewwer
-
Feb 25th, 2004, 08:08 AM
#6
Thread Starter
New Member
HI. biswajitdas and alex_read
Can you guive me code in order to determine how object are in memory ?
Thanks.
-
Feb 25th, 2004, 08:13 AM
#7
Try this sort of thing all throughout your project:
VB Code:
Dim objXLApp as Excel.Application
Set objXLApp = new Excel.Application
If not (objXLApp is nothing) then
' Object's created fine - run code against it here
objXLApp.workbooks(1).close
objXLApp.Quit
Set objXLApp = nothing
End If
By doing this, you avoid errors when you check the objects are open/created before you use them, and you release them from memory shen they are no longer needed (most objects will have some kind of close() or exit() etc. method you can call & you should always use the "Set xyz = nothing" call when you're finished with an object)...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|