View Single Post
 
Old 03-04-2014, 03:02 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Since your Excel object could have been inserted either in-line or floating, the following macro caters for both:
Code:
Sub ReSize()
With Selection
  If .InlineShapes.Count <> 0 Then
    With .InlineShapes(1)
      .LockAspectRatio = True
      .Height = .Height * 0.6
    End With
  End If
  If .ShapeRange.Count <> 0 Then
    With .ShapeRange(1)
      .LockAspectRatio = True
      .Height = .Height * 0.6
    End With
  End If
End With
End Sub
As coded, the macro works with a selected object (it doesn't have to be an Excel one). If you're inserting the object via code, there would be no need to select it; instead you could set a reference to it and use that.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote