View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
nath nath is offline
external usenet poster
 
Posts: 57
Default setting chart axes


-----Original Message-----
I am attempting to give all of my charts the same scale

and font size using a Macro. When I attempt to run the
following code, it breaks after a few iterations and then
says that it is 'Unable to get the chartobjects property
of the worksheetclass'
What's wrong?

Sub macrotitlesize()
For i = 0 To 12
ActiveSheet.ChartObjects(i + 1).Activate
ActiveChart.Axes(xlCategory).MajorUnitScale = xlYears
ActiveChart.Axes(xlCategory).MinorUnitScale = xlMonths
ActiveChart.Axes(xlCategory).Crosses = xlCustom
ActiveChart.Axes(xlCategory).AxisBetweenCategories =

True
ActiveChart.Axes(xlCategory).ReversePlotOrder = False
ActiveChart.Axes(xlCategory).MinimumScale = "1/1/2000"
ActiveChart.Axes(xlCategory).MaximumScaleIsAuto = True
ActiveChart.Axes(xlCategory).MajorUnit = 1
ActiveChart.Axes(xlCategory).MinimumScale = "1/1/2000"
ActiveChart.Axes(xlCategory).MaximumScaleIsAuto = True
ActiveChart.Axes(xlCategory).MinorUnitIsAuto = True
ActiveChart.Axes(xlCategory).MinorUnit = 1
ActiveChart.Axes(xlCategory).CrossesAt = "1/1/2000"
Next i
End Sub

.Try for each cht in activesheet.chartobjects for the

start of your for next loop. then use activesheet.chart
(cht).

I think that should help any probs drop another post on
this and address it to me and i'll look a little deeper
into it.

Nath