Reputation: 25
In Visio I am trying to change the shape's x and y coordinates. I am using the following code
VisioApp.ActiveWindow.Page.Shapes.Item(uniqueId).CellsSRC(visSectionObject, visRowXFormOut, visXFormPinX).FormulaForceU = "18 in"
VisioApp.ActiveWindow.Page.Shapes.Item(uniqueId).CellsSRC(visSectionObject, visRowXFormOut, visXFormPinY).FormulaForceU = "-13.77 in"
but after running the code the shape's coordinate becomes (14.25, -34.27). The code changes the coordinates but doesnt give the intended result. Any idea on how to fix it ?
Upvotes: 2
Views: 2641
Reputation: 1734
On my side your code works ! Try define shape variable
Dim sh As Shape Set sh = VisioApp.ActiveWindow.Page.Shapes.Item(UniqueID) sh.CellsSRC(visSectionObject, visRowXFormOut, visXFormPinX).FormulaForceU = "18 in" sh.CellsSRC(visSectionObject, visRowXFormOut, visXFormPinY).FormulaForceU = "-13.77 in"
UPDATE
Please open page's shapeshet and check Ruler & Grid section
If XRulerOrigin/YRulerOrigin is not equal 0 then you can see incorrect coordinates for shapes in window Size & Position
Upvotes: 1