Pavlin II:
Thanks for getting back to me again.
I guess I will have to learn to use Matlab, but it's very expensive.
Tom
==============
: :
: : Pavlin II:
: :
: : Thanks so much for getting back to me about this! I have only been doing graphics with Visio, and not getting into the underpinnings.
: :
: : My boss says it should be easy for a user to change a mass figure in Excel, and then the Visio shape (a spacecraft headed for Mars) becomes larger or smaller, depending on how much fuel the ship burns, but it's been years since I used VB and I have to get back into it.
: :
: : Thanks again,
: : Tom
: :
: : =================================================
: : : : How can I have a Visio Shape change its size proportionally, when a User inputs (updates) a number in Excel?
: : : :
: : : :
: : : :
: : : Hi,
: : : you can access this shape via MySheet (or ActiveSheet).Shape(index)
: : : where index is index of shape on your sheet. If there is only one, you don't need to check if you have correct index, just use 1 :).
: : : When you find this, you can do whatever you want..
: : :
Dim MyShape As Shape
: : : Set MyShape = ActiveSheet.Shapes(1)
: : : 'Scaling
: : : MyShape.ScaleWidth 1.11, msoFalse, msoScaleFromTopLeft
: : : MyShape.ScaleHeight 1.21, msoFalse, msoScaleFromTopLeft
: : : 'Sizing
: : : MyShape.Width = 500
: : : MyShape.Height = 500
: : : 'Moving
: : : MyShape.IncrementLeft 128.25
: : : MyShape.IncrementTop 128.25
: : : 'Or
: : : MyShape.Left=100
: : : MyShape.Top=100
You can let user to click on some button after inserthing his input or you can use SelectionChanged event of worksheet to recognise that user entered number.. (Text Target.Row and Target.Column to make sure that user changed correct cell, or changed the cell you care about..)
: : :
: : : Hope this helps..
: : :
: : :
Pavlin II[/size]
: : :
: : :
Don't take life too seriously anyway you won't escape alive from it!
: : :
: : :
: : :
: :
: :
:
: Hi,
: I'm back again. I've tried to change size of something inside Visio object and now I'm sure it's not possible. (Not realisable easy)..
: You can simulate double click on the shape, but it start native visio designer and there's no VBA access to inner features of it.. Sorry..
:
:
:
Pavlin II[/size]
:
:
Don't take life too seriously anyway you won't escape alive from it!
:
:
: