
Visio.Application (COM object) Speed
obviously with no knowledge of how you're doing it these
approxmate shooting in the dark, but here goes anyway.
Understand from the beginning that VB.NET assumes that all
of this is across multiple platforms so under the covers
it uses a lot of the network stuff which can really slow
it down even on a standalone system. On my system (p4
254Mhz, 1G memory) the same app took 5 to 6 times as long
to run under vb.net as when it compiled under vb6. I had
to rearchitect it to perform acceptably under vb.net.
1. open files as few times as is absolutely necessary and
put a lot of stuff into memory arrays so it doesn't have
to go out again. With 8 pages x 112 objects you should be
able to run this inside the app and then call the update
routine only once.
2. use 'doevents' as often as possible so that i/o queues
don't back up (especially in embedded loops where you are
playing with external data). This can happen with ole
automation where the i/o may be coming from the ole server
and not necessarily from your app. it was the only way I
could get database performance up (access and sql server
local).
good luck, hope this helps,
al
Quote:
>-----Original Message-----
>I've created a VB solution that employs the Visio COM
>object to loop through and edit all objects on a
>given .vsd file. The code works great except that runs
>very slowly.
>Some information:
>* there are 8 pages with approx 112 objects per page
>* the Visio doc is set to invisible to maximize speed
>(Visio.invisibleapp)
>* the entire process takes upwards of 60 seconds to
>execute
>* VB.NET is the coding platform
>What options do I have to speed this process up? I have
>read other posts saying that the speed is determined by
>the OLE Automation and not by the screen redraw. Because
>of this, I have tried to minimize the code that modifies
>the .vsd in any way. The code is very brief.
>I have also looked into actually saving the .vsd file as
>a .vdx file and, instead of changing the actual Visio
>document itself, change the XML in the .vdx... this
>sounds good in theory, but there still seem to be
>problems with XML schemas created by Visio. Most notably,
>the error "The same table (table name here) cannot be the
>child table in two nested realations." which you get
>when, from .NET, select the Data view instead of the XML
>view.
>Any help is appreciated! Thx
>.