0
votes

I have some code that generates Visio masters for me, and some masters have auto-generated Action sections with 1 or more actions. What I'd like to do is drop each of these masters into a page, and run through the list of actions in the shapes, and execute each one, and check to see if they complete without error.

My actions all use CALLTHIS to execute VBA code, so I guess it's possible to maybe use Application.ExecuteLine, and then I'd just have to parse the CALLTHIS and its arguments. But I'm wondering, is there some mechanism in Visio VBA that would let me programmatically execute an action, or am I stuck doing it all myself?

1

1 Answers

1
votes

There's a Trigger method on the cell object so you could iterate through you Action rows something like this:

Private Sub TriggerActionCells(ByRef shpIn As Shape)
If Not shpIn Is Nothing Then
    If shpIn.SectionExists(visSectionAction, 0) Then
        Dim iRow As Integer
        For iRow = 1 To shpIn.RowCount(visSectionAction)
            shpIn.CellsSRC(visSectionAction, iRow - 1, visActionAction).Trigger
        Next iRow
    End If
End If
End Sub