F
Francois
I have an application that builds automatic QC graphs from imported data from a user database (another excel file). This one row of data is then plotted on a graph with its specific upper and lower limit values
My problem is that the specific data changes depending on the type of data, each type has its own upper and lower limits. I can get the chart to import the type of data that I select in a combo box, and the limits values will then be grouped specifically. I get the error when I want to display the graph (the code below is part of what builds the graph) and change the names of the series to the specifc type data that I imported
Error '1004': Unable to set the Name Property of the Series Clas
Sheets("Calcs").Selec
Select Case SectionNumbe
Case 1 'TM (Total Moisture
coaldata = Sheets("Calcs").Range("B11:AF11"
UL = Sheets("Calcs").Range("B12:AF12"
LL = Sheets("Calcs").Range("B13:AF13"
Case 2 'C
coaldata = Worksheets("Calcs").Range("B14:AF14"
UL = Sheets("Calcs").Range("B15:AF15"
LL = Sheets("Calcs").Range("B16:AF16"
Case 3 'As
coaldata = Worksheets("Calcs").Range("B17:AF17"
UL = Sheets("Calcs").Range("B18:AF18"
LL = Sheets("Calcs").Range("B19:AF19"
Case 4 'V
coaldata = Worksheets("Calcs").Range("B20:AF20"
UL = Sheets("Calcs").Range("B21:AF21"
LL = Sheets("Calcs").Range("B22:AF22"
Case 5 'A
coaldata = Worksheets("Calcs").Range("B23:AF23"
UL = Sheets("Calcs").Range("B24:AF24"
LL = Sheets("Calcs").Range("B25:AF25"
BVal = Sheets("Calcs").Range("B26:AF26"
Sheets("Coal Graph").Selec
With ActiveChar
.HasTitle = Tru
.ChartTitle.Text = "QC GRAPH" & Chr(10) & QCType & Chr(10) & MonthTyp
If SectionNumber = 5 The
ActiveChart.SeriesCollection.NewSerie
ActiveChart.SeriesCollection(4).Values = Sheets("Calcs").Range("B26:AF26"
ActiveChart.SeriesCollection(4).Name = "BASE VALUE
Els
.SeriesCollection(1).Values = coaldat
.SeriesCollection(1).Name = "ACTUAL
.SeriesCollection(2).Values = U
.SeriesCollection(2).Name = "UPPER LIMIT
.SeriesCollection(3).Values = L
.SeriesCollection(3).Name = "LOWER LIMIT
If .SeriesCollection.Count = 4 The
.SeriesCollection(4).Delet
End I
End I
.SeriesCollection(1).Name = "ACTUAL
.SeriesCollection(1).Values = coaldat
.SeriesCollection(2).Name = "UPPER LIMIT
.SeriesCollection(2).Values = U
.SeriesCollection(3).Name = "LOWER LIMIT
.SeriesCollection(3).Values = L
End With
My problem is that the specific data changes depending on the type of data, each type has its own upper and lower limits. I can get the chart to import the type of data that I select in a combo box, and the limits values will then be grouped specifically. I get the error when I want to display the graph (the code below is part of what builds the graph) and change the names of the series to the specifc type data that I imported
Error '1004': Unable to set the Name Property of the Series Clas
Sheets("Calcs").Selec
Select Case SectionNumbe
Case 1 'TM (Total Moisture
coaldata = Sheets("Calcs").Range("B11:AF11"
UL = Sheets("Calcs").Range("B12:AF12"
LL = Sheets("Calcs").Range("B13:AF13"
Case 2 'C
coaldata = Worksheets("Calcs").Range("B14:AF14"
UL = Sheets("Calcs").Range("B15:AF15"
LL = Sheets("Calcs").Range("B16:AF16"
Case 3 'As
coaldata = Worksheets("Calcs").Range("B17:AF17"
UL = Sheets("Calcs").Range("B18:AF18"
LL = Sheets("Calcs").Range("B19:AF19"
Case 4 'V
coaldata = Worksheets("Calcs").Range("B20:AF20"
UL = Sheets("Calcs").Range("B21:AF21"
LL = Sheets("Calcs").Range("B22:AF22"
Case 5 'A
coaldata = Worksheets("Calcs").Range("B23:AF23"
UL = Sheets("Calcs").Range("B24:AF24"
LL = Sheets("Calcs").Range("B25:AF25"
BVal = Sheets("Calcs").Range("B26:AF26"
Sheets("Coal Graph").Selec
With ActiveChar
.HasTitle = Tru
.ChartTitle.Text = "QC GRAPH" & Chr(10) & QCType & Chr(10) & MonthTyp
If SectionNumber = 5 The
ActiveChart.SeriesCollection.NewSerie
ActiveChart.SeriesCollection(4).Values = Sheets("Calcs").Range("B26:AF26"
ActiveChart.SeriesCollection(4).Name = "BASE VALUE
Els
.SeriesCollection(1).Values = coaldat
.SeriesCollection(1).Name = "ACTUAL
.SeriesCollection(2).Values = U
.SeriesCollection(2).Name = "UPPER LIMIT
.SeriesCollection(3).Values = L
.SeriesCollection(3).Name = "LOWER LIMIT
If .SeriesCollection.Count = 4 The
.SeriesCollection(4).Delet
End I
End I
.SeriesCollection(1).Name = "ACTUAL
.SeriesCollection(1).Values = coaldat
.SeriesCollection(2).Name = "UPPER LIMIT
.SeriesCollection(2).Values = U
.SeriesCollection(3).Name = "LOWER LIMIT
.SeriesCollection(3).Values = L
End With