Hey there,
i have written a vba code to export shape datas from visio to an excel file. its working pretty well. now i want to exclude all connectors i have used in my visio flow chart. my idea was something like ...
dim connector as "connectors"
....
If connector = "connectors"
" do nothing with my excel file"
do u have any idea how can i select just the connector ?
what are you mean as connector ?
I mean the lines between the shapes, my code recognizes that connector lines as a shape without data and produce a blank line in my excel file
you mean dynamic connectors ?
yes dynamic connectors, sorry ^^
You need to check if the shape is 1D or 2D. Please see the sample code below
Private Sub Trial()
For Each shp In ActivePage.Shapes
If shp.OneD Then
GoTo NextShp
Else
'Do your stuff like export to excel, etc.
End If
NextShp:
Next shp
End Sub
try also
Dim sh As Shape
Set sh = ActiveWindow.Selection.PrimaryItem
If sh.Master = "Dynamic connector" Then ' exclude that shape
Thanks for your replies. Well i tried
For Each shp In ActivePage.Shapes
If shp.OneD Then
GoTo Nextshp
Else
i = i + 1
blatt.Cells(i, 1).Value = shp.Cells("prop.ShapeNumber").Formula
blatt.Cells(i, 2).Value = shp.Cells("prop.NameDE").ResultStr("")
If shp.CellExists("prop.Typ", True) Then
blatt.Cells(i, 3).Value = shp.Cells("prop.Typ").ResultStr("")
Else
blatt.Cells(i, 3).Value = ""
End If
End If
But this is not working cause of that "GoTo Nextshp"
Got it, thanks guys :)