NiclasmitC
New Member
- Joined
- Mar 9, 2021
- Messages
- 1
- Office Version
- 365
- Platform
- Windows
Hello!
I am trying to create a value stream map using Excel data. Within an Excel tool I am given all the necessary data of the individual processes and can transform them freely.
I have already copied some lines of code from other threads and manage to open a Visio document, open the template to be used and place shapes from the template in the Visio document.
What is the best way to fill the created shapes with the existing data?
The diagram to be created should be filled automatically, regardless of the number of shapes created.
Here is my current code:
Thanks for you help and best regards!
Niclas
I am trying to create a value stream map using Excel data. Within an Excel tool I am given all the necessary data of the individual processes and can transform them freely.
I have already copied some lines of code from other threads and manage to open a Visio document, open the template to be used and place shapes from the template in the Visio document.
What is the best way to fill the created shapes with the existing data?
The diagram to be created should be filled automatically, regardless of the number of shapes created.
Here is my current code:
VBA Code:
Sub Wertstrom_Diagramm()
On Error GoTo HandleError
Dim AppVisio As Object
Dim n As Integer
Dim i As Integer
Dim RelPfad As String
n = Range("C4").Value
RelPfad = ThisWorkbook.Path & "\Automatisiert.vssx"
Set AppVisio = CreateObject("visio.application")
AppVisio.Visible = True
AppVisio.Documents.AddEx "", visMSDefault, 0 'Open Blank Visio Document
AppVisio.Documents.OpenEx RelPfad, visOpenRO + visOpenDocked 'Add Basic Stencil
AppVisio.Windows.ItemEx(1).Activate
AppVisio.ActiveWindow.Page.Drop AppVisio.Documents.Item(RelPfad).Masters.ItemU("Kunde"), 2, 2
HandleError:
MsgBox "Error"
Exit Sub
End Sub
Thanks for you help and best regards!
Niclas