LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 35
Default Unable to get SeriesCollection runtime error

Hi, I have code within Excel that is called after choosing
different parameters to plot from a custom toolbar.

If I have chosen to plot only one parameter, the code works fine.
However, if I choose an option that plots several
parameters (one plot for each) at a time, the code returns a
run-time error 1004 as it tries to plot the second chart.

The data for the series ranges for the second chart is valid, and
I can manually plot them. I don't understand why more than one
chart at a time can't be plotted.

Here is a code snippet at where the problem occurs:

Sub Plot_Normal(xlbook, xlsheet)
'for each 'normal' parameter sheet
Dim strName As String

For i = 1 To ncount
' counts number of company entrys for a category
mCCount = 0
Sheets(parameter(i)).Select

....code places data for the parameter(i) (declared a public
array) worksheet into a new range on the sheet passed as xlsheet
to this procedure, for parameter(i)....(code not shown here)
.................................................. ......

' loads ranges of data sets into 'range' variables
Dim rangeX As Range
Dim rangeMet As Range
Dim rangeEng As Range
Dim rangeCX As Range
Dim rangeCMet As Range
Dim DLrange As Range

' ranges for chart series'
Set rangeX = .Range(.Cells(1 + datacount, 3), _
.Cells(mCount(i) + datacount, 3))
Set rangeMet = .Range(.Cells(1 + datacount, 1), _
.Cells(mCount(i) + datacount, 1))
Set rangeEng = .Range(.Cells(1 + datacount, 2), _
.Cells(mCount(i) + datacount, 2))
Set rangeCX = .Range(.Cells(1 + datacount, 5), _
.Cells(mCCount + datacount, 5))
Set rangeCMet = .Range(.Cells(1 + datacount, 4), _
.Cells(mCCount + datacount, 4))
Set DLrange = .Range(.Cells(1 + datacount, 6), _
.Cells(mCCount + datacount, 6))
End With

' plots each category with at least one 'company'
mill in that category
' and formats data series
'chart name is parameter and then category abbrev.
strName = parameter(i) & category(i)

.Charts.Add.Name = strName

.ActiveChart.ChartType = xlXYScatter
With .ActiveChart
With .SeriesCollection(1)

at this point, I receive the run-time error "unable to get the
SeriesCollection property of the Chart class."
I've been working on this for about a week, and have just about
lost my mind!!!! As I said, it works once through,
then chokes on the second chart.

Thank you for your help, in advance,
Kate
 
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
Runtime error Anthony Excel Discussion (Misc queries) 1 October 9th 05 01:28 AM
Runtime error '1004' General ODBC error star_lucas New Users to Excel 0 August 29th 05 04:09 PM
Help: runtime error - Method seriescollection object_chart failed huangx06 Charts and Charting in Excel 3 July 9th 05 12:27 AM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
Runtime Error 9 Lizz45ie Excel Discussion (Misc queries) 1 May 27th 05 08:44 PM


All times are GMT +1. The time now is 07:36 PM.

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

About Us

"It's about Microsoft Excel"