Upgrading from Excel X (pre-2004) to Excel 2008.
Thinking I have most of the syntax conversions nailed-down or kludged on an important script of mine, except this last bit.
I was using the Excel command “ChartWizard”, which would update a pre-existing chart in-place by simply extending the dataset it was based on.
So for example if I had a dataset that spanned 25 rows and an associated chart, Excel could update the chart if I added a 26th row based on the current format of the chart (without a complete rebuild). It was done this way:
ChartWizard ActiveChart Source myRange Gallery xlLine Format 4 PlotBy xlColumns Title "Title of Chart" CategoryAxisTitle "DATE" ValueAxisTitle "FREE SPACE" without HasLegend
(with myRange being the new data range from another tab in the worksheet)
This command only worked on a pre-existing chart.
It took a while to figure this out originally, and now it looks like ChartWizard does not exist in Excel 2008. Am I back to re-inventing the wheel?
Do you have a space between Chart and Wizard?
–above code works fine in Excel X (Excel pre-2004)
–according to the Excel 2004 scripting guide that others have pointed me to, Chart Wizard is not supported
–if it works in Excel 2008, I cannot figure it out (and my guess would be is all the qualifiers have changed)
When I import the AppleScript library to Script Editor from Excel 2004, Chart Wizard is listed.
chart wizard is in 2008 dictionary
Don’t have a chart to test,but this is the only way I could get your skript to compile
chart wizard ActiveChart source myRange gallery xlLine format 4 plot by xlColumns title "Title of Chart" category title "DATE" value title "FREE SPACE" without HasLegend
hope this puts you on the right tract
Thanks, that got me started. The Excel 2004 AppleScript scripting guide (the only PDF guide I’ve found for AppleScript for Excel) listed the feature as not working yet. Apparently it was enabled in later versions. Your hints gave me what I needed to scour the dictionary some more. Haven’t quite got it working right, but on the right track at least.
Of course, I was also reminded that Chart Wizard is not how I originally accomplished my task…I was using the ExtendSeries command in Excel (see separate thread), which no longer seems to be available.