If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
DoEvents alternative
Hi!
We are splitting a large page into several small pages. In order to do that we remove lines from the geometry section in a shapes shapesheet. When a row is deleted (for instance a LineTo row) we need to perform a DoEvents i the VB code. Otherwise the segment is not removed. The problem is that all these DoEvents makes the split functionality very slow. Is there another way to do this? /Anders |
#2
|
|||
|
|||
DoEvents alternative
The doevents in Vba is what gives the cycles back to the system to get some
work done and I use it a lot. That said, in a dotNet world it absolutely will fry performance. Some things to look at : consider putting in a formula modified event processor to put a throttle on the things that you really need. (I use two event processors, one for doc/page events that I need and one to watch the other events that I want). consider wrapping your busy code in something like this ThisDocument.Application.DeferRecalc = True ThisDocument.Application.InhibitSelectChange = True ThisDocument.Application.ScreenUpdating = False don't forget to turn the stuff back when your done consider wrapping your busy code in begin/undo scope so that your application has a flag for when your busy. HTH al "Anders" wrote: Hi! We are splitting a large page into several small pages. In order to do that we remove lines from the geometry section in a shapes shapesheet. When a row is deleted (for instance a LineTo row) we need to perform a DoEvents i the VB code. Otherwise the segment is not removed. The problem is that all these DoEvents makes the split functionality very slow. Is there another way to do this? /Anders |
#3
|
|||
|
|||
DoEvents alternative
forgot to mention that the formula changed event processor is based on using
filters, there's a good example in the visio sdk al "Al Edlund" wrote: The doevents in Vba is what gives the cycles back to the system to get some work done and I use it a lot. That said, in a dotNet world it absolutely will fry performance. Some things to look at : consider putting in a formula modified event processor to put a throttle on the things that you really need. (I use two event processors, one for doc/page events that I need and one to watch the other events that I want). consider wrapping your busy code in something like this ThisDocument.Application.DeferRecalc = True ThisDocument.Application.InhibitSelectChange = True ThisDocument.Application.ScreenUpdating = False don't forget to turn the stuff back when your done consider wrapping your busy code in begin/undo scope so that your application has a flag for when your busy. HTH al "Anders" wrote: Hi! We are splitting a large page into several small pages. In order to do that we remove lines from the geometry section in a shapes shapesheet. When a row is deleted (for instance a LineTo row) we need to perform a DoEvents i the VB code. Otherwise the segment is not removed. The problem is that all these DoEvents makes the split functionality very slow. Is there another way to do this? /Anders |
Thread Tools | |
Display Modes | |
|
|