View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Chart Sheet/Axes

I am referencing the chart sheet via (Excel.Application).Charts(1)

try a referencing a workbook chart sheet in the Workbook's Charts or Sheets
collection

Sub test()
Dim cht As Chart

Set cht = ActiveWorkbook.Charts("Chart3")

With cht.Axes(xlValue)
'might need to set respective 'ScaleIsAuto
'.MinimumScaleIsAuto = False
'.MaximumScaleIsAuto = False
.MinimumScale = 0
.MaximumScale = 1.2
End With

End Sub

If you are automating Excel then qualify the workbook with your xlApp ref.

Regards,
Peter T

"Patrick" wrote in message
oups.com...
This seems like and probably is a trivial question, but I can't seem to
get it right. I've browsed through this group and found seemingly many
solutions that apply to chart objects, but not with a seperate chart
sheet im working with.

I am referencing the chart sheet via (Excel.Application).Charts(1)
like:

xlApp.Charts(1).Select

I am trying to find a simple way to read the min/max scale of the Y
axis, and if they are 0 to 1, change to 0 to 1.2. I've tried many
variations but can't seem to find one that actually works -- I also
recorded a macro to set this and it wouldnt seem to work either. Can
anyone provide a quick sample of what might be used to retrieve and/or
set the min/max scale values on a seperate chart sheet?

TIA

Pat