Using Visio shape.getFormulas

0

I would like to extract some Information out of Visio shapes using vb.net. Therefore I think shape.getFormulas is the best opportunity.

By executing this line I get the error:

Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))

(I read in other posts that there might be a problem if SID_SRCStream is defined as Integer an not Int16, but this shouldn't be the problem)

The code works VB6/VBA, so there shouldn't be any problems with sytax or definition of SID_SRCStream.

Does anyone has an ideas what might be wrong with my code?

Code:

Dim x as object = Nothing
Dim SID_SRCStream = New Int16(58 * 3) {}

'fill SID_SRCStream with values

With vis.ActiveDocument

        For Each page In .Pages
            If Strings.Left(page.Name, 5) = "Autom" Then
                For Each shapeX In page.Shapes
                    If Strings.Left(shapeX.Name, 15) = "Messstellen mit"   Then
                        shapeX.GetFormulas(SID_SRCStream, x)
                    End If
                Next
            End If
        Next

end With
vb.net
binding
visio
asked on Stack Overflow Jan 24, 2018 by laurenz • edited Jan 24, 2018 by braX

1 Answer

0

Try Dim SID_SRCStream() As Int16 instead of your current declaration (which is not VBA).

answered on Stack Overflow Jan 24, 2018 by AJD

User contributions licensed under CC BY-SA 3.0