ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Series Object and Values Property (https://www.excelbanter.com/excel-programming/373361-series-object-values-property.html)

Ronald Dodge

Series Object and Values Property
 
At times, the program uses the Values property without erroring out, but
doesn't actually set the Values property on the series, and other times, it
errors out. See the snippet below.


With .SeriesCollection()
If .Count 2 Then
For I = .Count To 3 Step -1
.Item(I).Delete
Next I
End If
For I = 1 To 2 Step 1
With .Item(I)
.Values =
Workbooks("0271321_Production-2.xls").Worksheets("Charts").Range("C55:J55")
'This is the line that isn't working properly.
.Name =
Workbooks("0271321_Production-2.xls").Worksheets("Charts").Range("$B$55")
'This line isn't working peroperly either.
.ChartType = xlArea
With .Border
.Weight = xlThin
.LineStyle = xlNone
End With
.Shadow = False
With .Interior
.ColorIndex = 2
.Pattern = xlSolid
End With
End With 'Series 2
Next I
End With 'Series Collection


The macro recorder showed the Values property as having a string value,
which it always errors out on me with that and the help files shows it
should be either a range object or a values collection, but not both. Not
only that, but the macro recorder used the R1C1 reference format rather than
the normal default A1 reference format for it's string reference format.

I would hate to have to do this manually for 3 different charts on each
machine file and on a total of 15 different machine files.

--
Ronald R. Dodge, Jr.
Production Statistician/Programmer
Master MOUS 2000



Ronald Dodge

Series Object and Values Property
 
Article 139327 answered the question as to why, which that article was
written to apply to XL97, XL98, but this also apply to XL2002.

I am not pleased about this as it means that I have to hardcode the formula
to be adjusted to return a blank to show up as a zero as well as set the
DisplayBlankAs to xlZero prior to making the changes and then reverse the
formula back to the original formula and reset the DisplayBlankAs back to
xlInterpolated after making the adjustments to the properties on the Series
object, just so as the impacted charts will function properly.

--
Ronald R. Dodge, Jr.
Production Statistician/Programmer
Master MOUS 2000

"Ronald Dodge" wrote in message
...
At times, the program uses the Values property without erroring out, but
doesn't actually set the Values property on the series, and other times,

it
errors out. See the snippet below.


With .SeriesCollection()
If .Count 2 Then
For I = .Count To 3 Step -1
.Item(I).Delete
Next I
End If
For I = 1 To 2 Step 1
With .Item(I)
.Values =

Workbooks("0271321_Production-2.xls").Worksheets("Charts").Range("C55:J55")
'This is the line that isn't working properly.
.Name =
Workbooks("0271321_Production-2.xls").Worksheets("Charts").Range("$B$55")
'This line isn't working peroperly either.
.ChartType = xlArea
With .Border
.Weight = xlThin
.LineStyle = xlNone
End With
.Shadow = False
With .Interior
.ColorIndex = 2
.Pattern = xlSolid
End With
End With 'Series 2
Next I
End With 'Series Collection


The macro recorder showed the Values property as having a string value,
which it always errors out on me with that and the help files shows it
should be either a range object or a values collection, but not both. Not
only that, but the macro recorder used the R1C1 reference format rather

than
the normal default A1 reference format for it's string reference format.

I would hate to have to do this manually for 3 different charts on each
machine file and on a total of 15 different machine files.

--
Ronald R. Dodge, Jr.
Production Statistician/Programmer
Master MOUS 2000






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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com