Using Excel VBA to Create a Visio Value Stream Map

NiclasmitC

New Member
Joined
Mar 9, 2021
Messages
1
Office Version
  1. 365
Platform
  1. 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:
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
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,214,832
Messages
6,121,849
Members
449,051
Latest member
excelquestion515

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top