Changing Visio Shape size when Excel data updates - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Changing Visio Shape size when Excel data updates

tjwilsontjwilson Posts: 3Member
How can I have a Visio Shape change its size proportionally, when a User inputs (updates) a number in Excel?


Comments

  • PavlinIIPavlinII Posts: 404Member
    : 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..
    [code]Dim MyShape As Shape
    Set MyShape = ActiveSheet.Shapes(1)
    [green]'Scaling[/green]
    MyShape.ScaleWidth 1.11, msoFalse, msoScaleFromTopLeft
    MyShape.ScaleHeight 1.21, msoFalse, msoScaleFromTopLeft
    [green]'Sizing[/green]
    MyShape.Width = 500
    MyShape.Height = 500
    [green]'Moving[/green]
    MyShape.IncrementLeft 128.25
    MyShape.IncrementTop 128.25
    [green]'Or[/green]
    MyShape.Left=100
    MyShape.Top=100[/code]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..

    [blue][b][italic][size=4]P[/size]avlin [size=4]II[/italic][/size][/b][/blue]

    [purple]Don't take life too seriously anyway you won't escape alive from it![/purple]


  • tjwilsontjwilson Posts: 3Member

    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..
    : [code]Dim MyShape As Shape
    : Set MyShape = ActiveSheet.Shapes(1)
    : [green]'Scaling[/green]
    : MyShape.ScaleWidth 1.11, msoFalse, msoScaleFromTopLeft
    : MyShape.ScaleHeight 1.21, msoFalse, msoScaleFromTopLeft
    : [green]'Sizing[/green]
    : MyShape.Width = 500
    : MyShape.Height = 500
    : [green]'Moving[/green]
    : MyShape.IncrementLeft 128.25
    : MyShape.IncrementTop 128.25
    : [green]'Or[/green]
    : MyShape.Left=100
    : MyShape.Top=100[/code]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..
    :
    : [blue][b][italic][size=4]P[/size]avlin [size=4]II[/italic][/size][/b][/blue]
    :
    : [purple]Don't take life too seriously anyway you won't escape alive from it![/purple]
    :
    :
    :

  • PavlinIIPavlinII Posts: 404Member
    :
    : 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..
    : : [code]Dim MyShape As Shape
    : : Set MyShape = ActiveSheet.Shapes(1)
    : : [green]'Scaling[/green]
    : : MyShape.ScaleWidth 1.11, msoFalse, msoScaleFromTopLeft
    : : MyShape.ScaleHeight 1.21, msoFalse, msoScaleFromTopLeft
    : : [green]'Sizing[/green]
    : : MyShape.Width = 500
    : : MyShape.Height = 500
    : : [green]'Moving[/green]
    : : MyShape.IncrementLeft 128.25
    : : MyShape.IncrementTop 128.25
    : : [green]'Or[/green]
    : : MyShape.Left=100
    : : MyShape.Top=100[/code]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..
    : :
    : : [blue][b][italic][size=4]P[/size]avlin [size=4]II[/italic][/size][/b][/blue]
    : :
    : : [purple]Don't take life too seriously anyway you won't escape alive from it![/purple]
    : :
    : :
    : :
    :
    :

    Hi,
    so you need to change size of some "object" (spacecraft image) inside the visio object nested inside excel sheet?

    I'm not sure this to be possible. I'll try to test this tomorrow..
    (I don't have Visio installed on this PC)..

    [blue][b][italic][size=4]P[/size]avlin [size=4]II[/italic][/size][/b][/blue]

    [purple]Don't take life too seriously anyway you won't escape alive from it![/purple]


  • PavlinIIPavlinII Posts: 404Member
    :
    : 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..
    : : [code]Dim MyShape As Shape
    : : Set MyShape = ActiveSheet.Shapes(1)
    : : [green]'Scaling[/green]
    : : MyShape.ScaleWidth 1.11, msoFalse, msoScaleFromTopLeft
    : : MyShape.ScaleHeight 1.21, msoFalse, msoScaleFromTopLeft
    : : [green]'Sizing[/green]
    : : MyShape.Width = 500
    : : MyShape.Height = 500
    : : [green]'Moving[/green]
    : : MyShape.IncrementLeft 128.25
    : : MyShape.IncrementTop 128.25
    : : [green]'Or[/green]
    : : MyShape.Left=100
    : : MyShape.Top=100[/code]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..
    : :
    : : [blue][b][italic][size=4]P[/size]avlin [size=4]II[/italic][/size][/b][/blue]
    : :
    : : [purple]Don't take life too seriously anyway you won't escape alive from it![/purple]
    : :
    : :
    : :
    :
    :

    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..


    [blue][b][italic][size=4]P[/size]avlin [size=4]II[/italic][/size][/b][/blue]

    [purple]Don't take life too seriously anyway you won't escape alive from it![/purple]


  • tjwilsontjwilson Posts: 3Member

    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..
    : : : [code]Dim MyShape As Shape
    : : : Set MyShape = ActiveSheet.Shapes(1)
    : : : [green]'Scaling[/green]
    : : : MyShape.ScaleWidth 1.11, msoFalse, msoScaleFromTopLeft
    : : : MyShape.ScaleHeight 1.21, msoFalse, msoScaleFromTopLeft
    : : : [green]'Sizing[/green]
    : : : MyShape.Width = 500
    : : : MyShape.Height = 500
    : : : [green]'Moving[/green]
    : : : MyShape.IncrementLeft 128.25
    : : : MyShape.IncrementTop 128.25
    : : : [green]'Or[/green]
    : : : MyShape.Left=100
    : : : MyShape.Top=100[/code]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..
    : : :
    : : : [blue][b][italic][size=4]P[/size]avlin [size=4]II[/italic][/size][/b][/blue]
    : : :
    : : : [purple]Don't take life too seriously anyway you won't escape alive from it![/purple]
    : : :
    : : :
    : : :
    : :
    : :
    :
    : 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..
    :
    :
    : [blue][b][italic][size=4]P[/size]avlin [size=4]II[/italic][/size][/b][/blue]
    :
    : [purple]Don't take life too seriously anyway you won't escape alive from it![/purple]
    :
    :
    :

Sign In or Register to comment.