문제

i would like to start a new Visio instance out of excel and execute some code. This works well, but it takes about 100x times longer to execute the code than executing the code directly in a visio macro.

Visio 2003

Dim visio_app As New Visio.Application
Dim doc As Visio.Document, pg As Visio.page

Set doc = visio_app.Documents.Open(.......)
Set pg = visio_app.ActivePage

'Performance problem runing this methode
delete.doDeleteDeleted visio_app, pg

......

No Performance issue when i start the code directly in visio

delete.doDeleteDeleted Application, Application.ActivePage

does anybody knows how to fix it?

Thank you for your help!

도움이 되었습니까?

해결책

I already found a workaround. I created a visio file which includes the doDeleteDeleted methode and a run sub which executes doDeleteDeleted. Then I use visio_app.ExecuteLine(....) to execute the code in the Visio file. This works, but its unattractive

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top