![]() |
#1
|
|||
|
|||
![]()
Hallo everybody!
First of all, please excuse me for my English, also please consider that I'm translating some terms from the Italian version of softwares... I've written a long and complex VBA code for Corel Draw 12: its execution takes a very long time to be completed. While it runs, CorelDraw freezes and hangs, and in its title bar I can read "(Not responding)". However the code always succesfully complete its operations. The problem is that this code is for people that maybe would force close CorelDraw without waiting this process to be terminated, thinking that everyting's blocked. How can I prevent this not-responding state? I have tried showing a MsgBox every 15 seconds. It says that everything's ok and asks for continuing. In this case the program freezes after about 9 secs, then after 6 the MsgBox pops up. It demonstrates that everything's ok, but this would be annoying: some executions could last for minutes! Can you please give me any hint to solve? Please consider that I could also show a Form with some kind of messages. Thank you! |
#2
|
||||
|
||||
![]()
It is difficult to trouble shoot your problem without know what calls you are making, and what your code is doing. You could be stuck in a loop, or important some huge files, or files that have huge style lists. :-)
My suggestion is always to break down you code into small segments and speed test each part, hopefully this will help find the issue. Once you are comfortable that the code is working efficiently, turn on Optimization to stop the screen refreshes. -Shelby |
#3
|
|||
|
|||
![]()
Thank you for your answer!
![]() I'm quite sure that my code is efficient: it has a very small amount of things to do, and it's really quick on simple handmade shapes. The problems come while dealing with the huge number of nodes of long texts converted to curves... I don't know anything about "turning on Optimization", can you please tell me some more about it? Thank you! |
#4
|
|||
|
|||
![]()
Try adding calls to DoEvents in your loops. This gives part of your time slice to windows so it can process messages.
-James |
#5
|
||||
|
||||
![]()
There are several items that can be turned on / off to improve performance, the biggest on is to turn off the screen redraws, this is done by:
Code:
Optimization = True Code:
Optimization = False Hopefully that will help, -Shelby |
#6
|
|||
|
|||
![]()
WOW!
![]() Do Events does prevent from "Not responding", and Optimization speeds the routine up! Great! Thank you both very much! ![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sendkeys Test with CD12 | knowbodynow | CorelDRAW/Corel DESIGNER VBA | 1 | 18-06-2010 08:47 |
Straightening Text in CD12 | knowbodynow | CorelDRAW/Corel DESIGNER VBA | 2 | 03-03-2006 08:41 |
CD12 Thumbnailer | chrstn | CorelDRAW/Corel DESIGNER VBA | 1 | 17-10-2005 09:19 |
why looks print from AI9 another then from CD12 | rudyj.zabijak | CorelDRAW/Corel DESIGNER VBA | 2 | 09-04-2005 15:10 |
CD12: Dialogbox | joexx | CorelDRAW/Corel DESIGNER VBA | 4 | 04-03-2004 07:08 |