(Msg. 1) Posted: Tue Sep 02, 2008 7:20 am
Post subject: DoEvents alternative Archived from groups: microsoft>public>visio>general (more info?)
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?
(Msg. 2) Posted: Tue Sep 02, 2008 6:02 pm
Post subject: RE: DoEvents alternative [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
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
(Msg. 3) Posted: Tue Sep 02, 2008 6:08 pm
Post subject: RE: DoEvents alternative [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
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
All times are: Eastern Time (US & Canada) (change)
Page 1 of 1
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum