LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Automation Error using Chartobjects

If your code is indeed as shown, the answer I think is simple: note you have
"Axes(x1Category)" where it should be "Axes(xlCategory)"
--
- K Dales


"looloo" wrote:

Good Afternoon, I did an extensive search through the archives and
could not find a similar problem. I am trying to manipulate a chart
within a chart. I receive the following error on the last line of
code: automation error 2147221080 (800401a8)

Here is the portion of code where it bombs:
Sub CreateNewTrendChartNew()

Dim trendRng As Range, avgRng As Range, axisRng As Range
Dim data_sheet As Worksheet
Dim columnz900 As Integer
Dim seriesLoop As Integer
Dim Trends_Chart As Chart, TrendAvg_Chart As Chart

Set Weekly_WB = Workbooks("H4.weeklys.test.xls")
Set data_sheet = Weekly_WB.Sheets("DATA")
Set Trends_Chart = Weekly_WB.Charts("Trends")


Trends_Chart.Activate
Charts.Add
ActiveChart.Name = "Trend Averages"
Set TrendAvg_Chart = Weekly_WB.Charts("Trend Averages")
TrendAvg_Chart.ChartType = xlColumnClustered
TrendAvg_Chart.SetSourceData Source:=avgRng, PlotBy:= _
xlColumns
For z = 1 To 12
TrendAvg_Chart.SeriesCollection(1).Delete
Next z
TrendAvg_Chart.SeriesCollection.NewSeries
TrendAvg_Chart.SeriesCollection(1).XValues = axisRng
TrendAvg_Chart.SeriesCollection(1).Values = avgRng
TrendAvg_Chart.Location Whe=xlLocationAsObject, Name:="Trends"
' BOMBS ON THE FOLLOWING LINE
TrendAvg_Chart.Axes(x1Category).TickLabels.NumberF ormat = "mmm"

End Sub


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run time error 1004 - unable to get the chartObjects property of the worksheet class hedgehog1 Excel Programming 1 April 10th 06 08:10 PM
Compile error automation error nikkiws Excel Programming 0 January 17th 06 08:24 AM
compile error automation error [email protected] Excel Programming 0 January 17th 06 08:06 AM
Automation Error, Unknown Error. Error value - 440 Neo[_2_] Excel Programming 0 May 29th 04 05:26 AM
Unknown where is the problem on the Runtime error - Automation error wellie Excel Programming 1 July 10th 03 08:12 AM


All times are GMT +1. The time now is 09:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"