Running Visio macros from Excel

A

Andre Rosenthal

hello
I have several Visio Macros performing work on shapes. I am trying to drive
these macros from an excel macro using the following code:
public Sub DriveVisio()
Dim visioApp As Visio.Application
Set visioApp = New Visio.InvisibleApp
Dim visioDoc As Visio.Document
Set visioDoc = visioApp.Documents.Open("C:\visio test.vst")
Dim visiopage As Visio.page
Set visiopage = visioDoc.Pages("Page-1")
visioDoc.ExecuteLine ("MainModule.CustomCommandHandler 100")
visioDoc.Close
visioApp.Quit
Set visioDoc = Nothing
Set visioApp = Nothing
End Sub
The code dies at ExecuteLine and I have been unable to find an equivalent
solution for this problem.

Does anyone out there knows a possible solution?

TIA,
Andre.
 
J

JuneTheSecond

Program expects there is a code in the MainModule like next, are you sure?
Public Sub CustomCommandHandler(IVallue as Integer)
Msgbox IValue
end su
 

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