Thread: [Solved] simple change chart in VBA
View Single Post
 
Old 07-05-2012, 01:28 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit 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

Hi LKnomad,

You haven't told your macro what objshape is. Try:
Code:
Sub ChangePieChart()
Dim objShape As Shape
Set objShape = Selection.ShapeRange(1)
objShape.Height = 250
End Sub
This could be reduced to:
Code:
Sub ChangePieChart()
Selection.ShapeRange(1).Height = 250
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote