Resize a shape in Visio from Excel (VBA)

maneav

New Member
Joined
Mar 24, 2016
Messages
1
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
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,223,702
Messages
6,173,959
Members
452,539
Latest member
delvey

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top