S
Sherlock
I thought I was going crazy till I found a similar post.
I am having a problem similar to the other post, where
ScaleHeight/ScaleWidth returns 0. My code also worked fine in 2003, but is
now broken.
In my case, I don't know what size the user will want the picture to be. In
2003, I got the desired width from the user in an InputBox. I applied that
value to Width. Then I scaled the height accordingly by making ScaleHeight
equal ScaleWidth:
UserWidth = InputBox ...
Selection.InlineShapes(1).Width = UserWidth
Selection.InlineShapes(1).LockAspectRatio = msoTrue
Selection.InlineShapes(1).ScaleHeight =
Selection.InlineShapes(1).ScaleWidth
Worked like a charm.
Now that ScaleHeight and ScaleWidth return 0, that line generates an error.
The width gets changed, but then the macro errors out and the height doesn't
get changed, even though LockAspectRatio equals True.
What do I need to do to my code to get it to work again?
And just out of curiosity, does anyone know why the functionality was changed?
Thanks very much for your help!
I am having a problem similar to the other post, where
ScaleHeight/ScaleWidth returns 0. My code also worked fine in 2003, but is
now broken.
In my case, I don't know what size the user will want the picture to be. In
2003, I got the desired width from the user in an InputBox. I applied that
value to Width. Then I scaled the height accordingly by making ScaleHeight
equal ScaleWidth:
UserWidth = InputBox ...
Selection.InlineShapes(1).Width = UserWidth
Selection.InlineShapes(1).LockAspectRatio = msoTrue
Selection.InlineShapes(1).ScaleHeight =
Selection.InlineShapes(1).ScaleWidth
Worked like a charm.
Now that ScaleHeight and ScaleWidth return 0, that line generates an error.
The width gets changed, but then the macro errors out and the height doesn't
get changed, even though LockAspectRatio equals True.
What do I need to do to my code to get it to work again?
And just out of curiosity, does anyone know why the functionality was changed?
Thanks very much for your help!