How to change the properties of a chart that is not active in Excel?

Version: MS Excel 2008
Operating System: Mac OS X 10.4.11

I want to change the properties like height and width etc of all charts in a sheet as that of the active chart.

I am getting the properties of active chart properly but unable to set the properties of other charts that are not active.

It seems as if the properties can’t be changed of the charts that are not active.

The code is below:

(Before running this code you must select one chart otherwise it will give missing value for active chart.)

tell application “Microsoft Excel”

tell active chart
	set chart_area to properties of chart area object
	set height_active_chart to height of chart_area
	set width_active_chart to width of chart_area
	set top_active_chart to top of chart_area
	set left_active_chart to left position of chart_area
end tell

repeat with chart_object in (get every chart object of active sheet)
	display dialog name of chart_object as text
	set height of properties of chart area object of chart_object to height_active_chart
	set width of properties of chart area object of chart_object to width_active_chart
end repeat

end tell

Any help would be appreciated.

Thanks!

Hi,

try this


tell application "Microsoft Excel"
	set {height:height_active_chart, width:width_active_chart, top:top_active_chart, left position:left_active_chart} to chart area object of active chart
	
	repeat with chart_object in (get every chart object of active sheet)
		display dialog (get name of chart_object)
		set height of chart_object to height_active_chart
		set width of chart_object to width_active_chart
	end repeat
end tell