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

S

sid_a

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top