OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-03-2004, 12:28
Rick Randall
Guest
 
Posts: n/a
Default "Failed to create new document" error

Hi-- I have a macro that reads lines from a text file. Each line contains the name of a .gif file, and some hotspot position coordinates.

Once it reads the line of info in the txt file...

1) the macro opens a new document and imports the .gif
2) the it draws rectangles on the doc based on the coordinate info read from the .txt file.
3) then it loops on to the next lines until finished.

Basically the thing works great as long as I run it on 1 to 30 files. If I go beyond this then I get a "Failed to create new document" error and everything locks up. When i monitor the system memory alloted to coreldraw when running this macro, it spikes up to 150,000 k. What can I do to not get this error when I try to run the macro on over 50 files?
Reply With Quote
  #2  
Old 08-03-2004, 14:16
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default Re: "Failed to create new document" error

Rick,

What do you do with the document once it is created? Do you save and close it or do you keep it open?

If you keep them open and your GIFs are not too small, I'd say you'll definitely max out your memory after opening some number of files like that.

However I think it should be OK if you save/close the files after processing.

Do you use CorelDRAW 10 or later. I remember that a memory leak problem was fixed in Draw 11 related to opening/closing documents through VBA. So I believe CorelDRAW 11/12 will be a better candidate for your job.

If you have to stick with DRAW 10 and find no other work around, I'd shut down and restart CorelDRAW after processing 30 or so files...
Reply With Quote
  #3  
Old 08-03-2004, 14:28
Rick Randall
Guest
 
Posts: n/a
Default running out of memory

i am using corel 11 and the gifs are under 100k. i tried saving the files each time and it does seem to work better. are there any coding teqniques for lower memory usage? Clearing variables? Breaking my subs into smaller modules? Any suggestions?
Reply With Quote
  #4  
Old 08-03-2004, 15:55
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default Re: running out of memory

Would you mind posting your code here so I can take a look at what exactly it does?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I create CustomShape with VBA for CD? Can I create tool? Jab CorelDRAW/Corel DESIGNER VBA 0 01-02-2005 05:02
Export filter compile error ddonnahoe CorelDRAW/Corel DESIGNER VBA 1 26-01-2004 09:15
"Unexpected condition" error message (with code) s_federici CorelDRAW/Corel DESIGNER VBA 10 10-07-2003 21:46
"Object too complex" error dcsquare CorelDRAW/Corel DESIGNER VBA 0 25-05-2003 10:13
Run-time error '-2147467259 (80004005) bbolte CorelDRAW/Corel DESIGNER VBA 5 12-12-2002 11:47


All times are GMT -5. The time now is 14:38.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com