G
Gary Shell
I am building an application that takes data from a database and creates a
Visio Document using the CrossFunctional Flowchart Template. It draws 20 or
more "swim lanes", places process blocks into appropriate lanes and add
lines to the left and right of each process block.
As the drawing progresses, I must periodically do Application.DoEvents to
see the progress. As the drawing completes it gets slower and slower and
slower.
I ran a profiler on the code and found that the code that actually creates
the drawing makes up a small amount of the total execution time. Total
execution time before I killed the app was 34853 seconds. The Profiler
shows my drawing code module named "crowsfeet" as consuming a total of 1010
seconds! I am assuming that points to the Visio OCX itself as taking all
the time.
I have a feeling this may be due to the template having code that is running
and every little cell change my code does causes the template code to
re-execute. So I am wondering if there is a way to suspend the template
code from executing constantly and have it do it's thing ONCE each time I do
my Application.DoEvents to refresh my view.
I remember in Excel there was/is a way to tell it to turn off calculations,
make some series of edits and then turn calculations back on. Can, and
SHOULD, Visio be told to do this in my case?
Or am I dealing with crossing the boundary between managed and unmanaged
code? And if so how can I mitigate this.
At the rate the app was going a complex drawing will take a couple of hours
to generate.
Gary
Visio Document using the CrossFunctional Flowchart Template. It draws 20 or
more "swim lanes", places process blocks into appropriate lanes and add
lines to the left and right of each process block.
As the drawing progresses, I must periodically do Application.DoEvents to
see the progress. As the drawing completes it gets slower and slower and
slower.
I ran a profiler on the code and found that the code that actually creates
the drawing makes up a small amount of the total execution time. Total
execution time before I killed the app was 34853 seconds. The Profiler
shows my drawing code module named "crowsfeet" as consuming a total of 1010
seconds! I am assuming that points to the Visio OCX itself as taking all
the time.
I have a feeling this may be due to the template having code that is running
and every little cell change my code does causes the template code to
re-execute. So I am wondering if there is a way to suspend the template
code from executing constantly and have it do it's thing ONCE each time I do
my Application.DoEvents to refresh my view.
I remember in Excel there was/is a way to tell it to turn off calculations,
make some series of edits and then turn calculations back on. Can, and
SHOULD, Visio be told to do this in my case?
Or am I dealing with crossing the boundary between managed and unmanaged
code? And if so how can I mitigate this.
At the rate the app was going a complex drawing will take a couple of hours
to generate.
Gary