VBA

Moderators: PavlinII
Number of threads: 1673
Number of posts: 3078

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Changing Visio Shape size when Excel data updates Posted by tjwilson on 18 Sept 2005 at 12:00 PM
How can I have a Visio Shape change its size proportionally, when a User inputs (updates) a number in Excel?


Report
Re: Changing Visio Shape size when Excel data updates Posted by PavlinII on 23 Sept 2005 at 6:20 AM
: 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!


Report
Re: Changing Visio Shape size when Excel data updates Posted by tjwilson on 25 Sept 2005 at 8:07 AM

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!
:
:
:

Report
Re: Changing Visio Shape size when Excel data updates Posted by PavlinII on 25 Sept 2005 at 12:54 PM
:
: 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,
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)..

Pavlin II[/size]

Don't take life too seriously anyway you won't escape alive from it!


Report
Re: Changing Visio Shape size when Excel data updates Posted by PavlinII on 26 Sept 2005 at 12:26 AM
:
: 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!


Report
Re: Changing Visio Shape size when Excel data updates Posted by tjwilson on 26 Sept 2005 at 6:54 PM

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!
:
:
:




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.