Getting the actual formula from a shapesheet cell

Started by iankoe, November 08, 2008, 12:20:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

iankoe

I want to trigger some actions when one of my shapes "connects" to another of my shapes.  The best way I can see to do this is if I can figure out how to pull the formula out of the PinX cell rather than the value.  But I am stumped.

When the shapes are disconnected, PinX has a simple number in it Like (3.6353).  But when the shapes (both 2-dimensional) connect, Visio places formulas into the PinX/PinY cells of my target shape of the form:


=PNTX(LOCTOPAR(PNT(Int2.19!Connections.X3,Int2.19!Connections.Y3),Int2.19!EventXFMod,EventXFMod))+0 in


indicating that my local shape is pinned to a connection point in the shape: "Int2.19".

I figure, if I could get at teh formula, I could do some interesting things relating the two shapes, but that is where I am stumped.

Any help woudl be appreciated.

Yacine

In all the examples, that I found in the Web, the connection informations where gotten by VBA code. shape.connections... and so on.

I'm also looking for a solution to evaluate the string and not the value of a formula, so I can extract the connection shape's name without macro.

Community and VisGuy! any idea?
Yacine

wapperdude

Here's a quick little macro that shows how to fetch the PinX formula.  (I tend to use msgbox instead of debug.print.)

Sub FetchCellFormula()
    Dim visShape As shape
   
    For Each visShape In ThisDocument.Pages(1).Shapes
        If visShape.Master <> "Dynamic connector" Then
            MsgBox visShape.CellsU("PinX").Formula
        End If
    Next
End Sub

HTH
Wapperdude
Visio 2019 Pro

Yacine

Thank you Wapperdude,
the deal is not to get the connections through VB code, but to read it directly by a function in the shapesheet.
It is so frustrating to see the connection in a formula in front of you and not beeing able to handle it.
Yacine