Hi everyone,I created a shape in Visio from Excel with VBA.Now, I would like to resize it the same way but it doesn't work. I unsuccessfully tried some expressions. I would appreciate if somebody can help me to find the right way to write it.
Code:
Sub Excel2Visio() Dim AppVisio As Object Dim oCharacters As Object Dim avarObjects As Object Set AppVisio = CreateObject("visio.application") AppVisio.Visible = True AppVisio.Documents.AddEx "", visMSDefault, 0 'Open Blank Visio Document AppVisio.Documents.OpenEx "basic_u.vss", visOpenRO + visOpenDocked 'Add Basic Stencil Set avarObjects = AppVisio.Documents.Item("BASIC_U.VSS").Masters.ItemU("rectangle") AppVisio.Windows.ItemEx(1).Activate AppVisio.ActiveWindow.Page.Drop avarObjects, 0, 0 ' modify Format Set test = AppVisio.ActiveWindow.Page.Shapes.avarObjects.CellsSRC(visXFormWidth).FormulaU = "3" ' <-- this doesn't work !!!!! Set oCharacters = AppVisio.ActiveWindow.Page.Shapes.ItemFromID(lX).Characters oCharacters.Begin = 0 oCharacters.End = Len(oCharacters) sChar = "Test funktioniert" oCharacters.Text = sChar Set oCharacters = Nothing Set AppVisio = Nothing End Sub