Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel VBA to execute Visio VBA
In VBA in Excel, go to the Tools menu and set a reference to "Visio 11 Type
Library" or whatever version of Visio you have. Then use code like the following. Sub AAA() Dim VIS As Visio.Application Dim VisDoc As Visio.Document On Error Resume Next Set VIS = GetObject(, "Visio.Application") If VIS Is Nothing Then Set VIS = CreateObject("Visio.Application") If VIS Is Nothing Then MsgBox "Cannot access Visio" Exit Sub End If End If On Error GoTo 0 VIS.Visible = True Set VisDoc = VIS.Documents.Add(Filename:="C:\Drawing2.vsd") '<<< CHANGE VisDoc.ExecuteLine "MacroName" '<<< CHANGE VisDoc.Close VIS.Quit End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) "Jason V" wrote in message ... My Excel VBA program opens a visio application. From there I either want to run a macro in that Visio file or I want to code it in my excel program. Any help? Thanks. -- Jason V |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Microsoft Visio templates - Stencil for Visio to create IT diagrams &network design | Excel Worksheet Functions | |||
Excel List to visio | Excel Discussion (Misc queries) | |||
Excel VBA to execute Visio VBA | Excel Programming | |||
Controlling Visio from within Excel | Excel Programming | |||
Excel to Visio to Word | Excel Programming |