Use "ExportToVisio" - excel macro - vba function to export Excel cross functional flowchart data to Visio diagram RRS feed

  • Question

  • Cross Functional Flowchart -Data Visualizer Excel template has an in-built export to Visio Diagram Menu option through which Visio Diagrams are directly created. 
    We have identified a VBA function - "ExportToVisio" (which can export data from Excel to Visio) to programmatically invoke it to export data from excel into a Visio diagram but it is creating a Visio Pivot diagram.
    Our requirement is to create a Visio Diagram which is displayed in a flow chart format. 
    Please help.
    Below is the sample code which we have tried to export excel data into Visio which is creating a Visio Pivot diagram.

    Note - The feature is only available on Visio Plan 2 for M365. If you do not have Visio Plan 2 installed then the 'Export Table to Visio Diagram' option will not be available.

    Sub Export()

    Dim objWorksheet As Worksheet 
    Dim objListObject As ListObject 

    Set objWorksheet = ActiveWorkbook.Worksheets("MyDataSheet") 

    If objWorksheet.ListObjects.Count > 0 Then 
       Set objListObject = objWorksheet.ListObjects(1) 
    End If 


    End Sub

    Wednesday, July 29, 2020 5:05 PM