-1

I want to assign a macro to a shape in Excel. When clicked will open a flow chart in Visio. What coding will work similar to below which opens an Excel workbook, but instead would open a specific *.vsdx file?:

Workbooks.Open "ANALYSIS.XLS"

26man
  • 31
  • 3

1 Answers1

0

Found help here: Open Visio Drawing using a Macro in Access 2010

This worked for me:

    Dim FName As String
    Dim VisioApp As Object
    On Error Resume Next
    Set VisioApp = GetObject(, "Visio.Application")
    If VisioApp Is Nothing Then
        Set VisioApp = CreateObject("Visio.Application")
        If VisioApp Is Nothing Then
            MsgBox "Can't connect to Visio"
            Exit Sub
        End If
    End If
    On Error GoTo 0
    FName = "C:\Imaging\BLI-LOCF Flow Diagram.vsdx"
    VisioApp.documents.Open FName '
    VisioApp.Visible = True
26man
  • 31
  • 3