Hi All,
I am having Microsoft Office 2013 installed in my laptop.
I have a requirement to develop code which creates Vision flow diagram with excel inputs. I have to use the organization chart of folder hierarchy using DIR and TREE commands. The diagram needs to show the files and folder hierarchy of a network drive. I have taken the data using DIR and TREE commands, but I don't know how to use this info in Visio.
Does anybody know any way to do this? Please help me on this one guys.
Need suggestions to draw in Visio with inputs from Excel
Hi,
You may try this!
Option Explicit
Sub VisioFromExcel()
   Dim AppVisio As Object
   Dim oCharacters As Object
   Dim lX As Long
   Dim sChar As String
  Â
   Set AppVisio = CreateObject("visio.application")
   AppVisio.Visible = True
  Â
   For lX = 1 To Cells(Rows.Count, 1).End(xlUp).Row
  Â
       AppVisio.Documents.AddEx "block_u.vst", 0, 0
       AppVisio.Windows.ItemEx(lX).Activate
       AppVisio.ActiveWindow.Page.Drop AppVisio.Documents.Item("BLOCK_U.VSS").Masters.ItemU("Box"), 1.35, 9.8
       AppVisio.ActiveWindow.Page.Shapes.ItemFromID(1).CellsSRC(visSectionCharacter, 0, visCharacterSize).FormulaU = "20 pt"
      Â
       Set oCharacters = AppVisio.ActiveWindow.Page.Shapes.ItemFromID(1).Characters
       oCharacters.Begin = 0
       oCharacters.End = Len(oCharacters)
       sChar = Cells(lX, 1).Value
       oCharacters.Text = sChar
  Â
   Next
  Â
   Set oCharacters = Nothing
   Set AppVisio = Nothing
  Â
End Sub
Hope this works for you!
Regards,
Okello Kelvin