issue on retrieving connectors cell coordinate info

  • Thread starter Gianluca Colaiacomo
  • Start date
G

Gianluca Colaiacomo

Hello I've got a weird issue I was not able to fix it.
I need to retrieve connectors cells coordinates, so I've created the
following subroutine.

Sub controlla(shapeID As Long)

Dim Figura_1 As Visio.Shape
Dim ClX, ClY, ClEX, ClEY As Visio.Cell

Set Figura_1 = Application.ActiveWindow.Page.Shapes.ItemFromID(shapeID)

Set ClX = Figura_1.CellsU("BeginX")
'Set CellaX = Oggetto_1.CellsSRC(visSectionObject, visRowXForm1D,
vis1DBeginX)
Set ClY = Figura_1.CellsU("BeginY")
Set ClEX = Figura_1.CellsU("EndX")
Set ClEY = Figura_1.CellsU("EndY")

Debug.Print "Shape: " & Figura_1 & " x=" & ClX & " y=" & ClY & " x_end=" &
ClEX & " y_end=" & ClEY

End Sub
------------------------------------------------------------------

The issue is when I run the main code calling the subroutine, I've got shape
with wrong coordinates infos:

Shape: Dynamic connector.9 x=-0.5 y=0.5 x_end=0.5 y_end=-0.5

If before calling the subroutine I'll introduce a pause just before calling
the sub. or better if I'm executing code while debugging, I'll get the right
infos:

Shape: Dynamic connector.9 x=11.8420969132807 y=6.94832557237496
x_end=8.53862438383869 y_end=6.26752845355849

Any suggestion?
Any help will be appreciated
cheers
Gianluca
 
A

Al Edlund

visio is a big spreadsheet that has to update a lot of cell information. it
is a good thing to include a lot of 'application.doevents' in your code so
that the system can catch up with what you are doing.
Al
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top