DoEvents alternative

A

Anders

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
 
A

Al Edlund

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
 
A

Al Edlund

forgot to mention that the formula changed event processor is based on using
filters, there's a good example in the visio sdk
al
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top