• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re:Possible bug with AppScript and Excel?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re:Possible bug with AppScript and Excel?


  • Subject: Re:Possible bug with AppScript and Excel?
  • From: Timothy Murphy <email@hidden>
  • Date: Fri, 30 Jul 2010 01:39:25 +0100

There is a difference in approach depending on whether you are creating, or addressing, a chart as an object in a worksheet, or as a chart sheet.
Charts embedded in a worksheet belong to the chart object class so, in general terms:
<some code...>
--::this creates the chart object itself
set oChartObj to make new chart object at end ¬
with properties{ whatever..}
--::address the chart element of the object
tell chart of oChartObj
set chart type to line chart
set newSeries to make new series at end ¬
with properties {series values:¬
(-insert reference-), xvalues:¬
(-insert reference-), name:¬
(-insert reference-)}
--::still addressing  the chart element of the object, we now address its category axis, or x axis
set categoryAxis to get axis axis type category axis ¬
which axis primary axis
tell categoryAxis
--set has title to true
set has title to false
set crosses at to maximum scale
end tell
--::still addressing  the chart element of the object, we now address its value axis, or y axis
set valueAxis to get axis axis type value axis ¬
which axis primary axis
tell valueAxis
set major unit is auto to true
set major tick mark to tick mark none --options are:¬
--tick mark cross / tick mark inside / tick mark none / tick mark outside
set minor tick mark to tick mark none
set tick label position to tick label position high --places value labels (ie. the scale) outside the chart
(*options are: tick label position high/tick label position low/tick label position next to axis/tick label position none*)
set maximum scale to 1
set minimum scale to 0
set has title to false
end tell
--::End Tell -- (telling chart of oChartObj)

If you are telling a chart sheet, there is a difference:
set myChart to (make new chart sheet at end of active workbook with properties {name:.....})


tell active chart
--::this line gets the data for a series
make its series with properties {series values:-insert ref-, xvalues:-insert ref-, name:-insert ref-}


set size with window to true
--set chart type to line chart
set chart type to xy scatter smooth 
set the_x_Axis to (get axis axis type category axis ¬
which axis primary axis)
tell the_x_Axis
set major unit is auto to false  --etc.etc.
end tell
end tell

I hope this answers your question regarding Excel. 
Regarding Python...nfc, sorry.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Layers in Acrobat
  • Next by Date: Possible bug with AppScript and Excel?
  • Previous by thread: Re: Possible bug with AppScript and Excel?
  • Next by thread: Possible bug with AppScript and Excel?
  • Index(es):
    • Date
    • Thread