News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Exclude Connectors

Started by longo93, June 21, 2016, 08:36:55 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

longo93

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 ?


Surrogate

what are you mean as connector ?

longo93

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

Surrogate

you mean dynamic connectors ?

longo93

yes dynamic connectors, sorry ^^

metuemre

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

Surrogate

try also
Dim sh As Shape
Set sh = ActiveWindow.Selection.PrimaryItem
If sh.Master = "Dynamic connector" Then ' exclude that shape

longo93

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"

longo93


Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 282 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1132KB.
Tokens: post-login.
Cache hits: 13: 0.00155s for 26,722 bytes (show)
Cache misses: 3: (show)
Queries used: 17.

[Show Queries]