Hi!
I have tens of visio shapes that I want to scale with 0.2 (text and arrows)
I can do the scaling in the shapesheet but only for one shape....
I tried to record a macro doing this, but it always throws an exception when it comes to opening the shapesheet:
Sub scale02()
' Tastenkombination: Strg+w
'
Application.ActiveWindow.Page.Selection.OpenSheetWindow
Shape.CellsSRC(visSectionObject, visRowXFormOut, visXFormWidth).FormulaU = 0.048
Application.ActiveWindow.Shape.CellsSRC(visSectionObject, visRowXFormOut, visXFormHeight).FormulaU = 0.0309
Application.ActiveWindow.Shape.CellsSRC(visSectionObject, visRowLine, visLineArrowSize).FormulaU = 2 * 0.2
End Sub
Thanks bunches,
Nico
You don't need to open the shapesheet window! The shapesheet editor is just for human use. Just remove that line.
Thanks a lot for answering so fast!
Unfortunately it doesn't work like this and i am not to much into vba with visio.
It throws the exception "object is necessary" or "exception occured" (I don't use visio in english, so I translated the messages).
Anyway, how can I refer to all shapes in the sheet? Why doesn't this work with ctrl+A ?
You can only do one shape at a time, your code needs to loop through all the shapes on a page and get a shape reference. There are many examples here on the Visio Guy forum of such code in VBA.