ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Obtaining Series Name and X/Y Value Ranges for Charts (https://www.excelbanter.com/excel-programming/271946-obtaining-series-name-x-y-value-ranges-charts.html)

Ed Hamilton

Obtaining Series Name and X/Y Value Ranges for Charts
 
In a VB application I'm trying to obtain the x and y data ranges for each
member of the seriescollection on a floating chart.

In my test case I can identify all the way down to the
SeriesCollection.count and then identify each of the four series by name
(Q1,Q2,Q3,Q4). I thought I had the code for obtaining the values of the
Series but keep getting an error.

The code I can't get is:

ActiveChart.SeriesCollection(1).xvalues

and it passes the "Run-time error '13': Type Mismatch"

Any ideas would be appreciated as it seems this is the correct code.

Ed



Carlos[_2_]

Obtaining Series Name and X/Y Value Ranges for Charts
 
To retrive info of a serie use .Formula properties
E.g.
With ActiveChart.SeriesCollection(serienumber)

FormulaSrs = .Formula
iNmBgn = InStr(FormulaSrs, "(") + 1
FormulaSrs = Mid(FormulaSrs, iNmBgn, Len(FormulaSrs) - iNmBgn)
DataChart = Split(FormulaSrs, ",")
SerieName=DataChart (0)
xValues=DataChart (1)
yValues=DataChart (2)
PlotOrder=DataChart (3)
end with

"Ed Hamilton" wrote in message
et...
In a VB application I'm trying to obtain the x and y data ranges for each
member of the seriescollection on a floating chart.

In my test case I can identify all the way down to the
SeriesCollection.count and then identify each of the four series by name
(Q1,Q2,Q3,Q4). I thought I had the code for obtaining the values of the
Series but keep getting an error.

The code I can't get is:

ActiveChart.SeriesCollection(1).xvalues

and it passes the "Run-time error '13': Type Mismatch"

Any ideas would be appreciated as it seems this is the correct code.

Ed





Ed Hamilton

Obtaining Series Name and X/Y Value Ranges for Charts
 
Fantastic. Exactly what I was looking for. Thanks.

ed

"Carlos" wrote in message
...
To retrive info of a serie use .Formula properties
E.g.
With ActiveChart.SeriesCollection(serienumber)

FormulaSrs = .Formula
iNmBgn = InStr(FormulaSrs, "(") + 1
FormulaSrs = Mid(FormulaSrs, iNmBgn, Len(FormulaSrs) - iNmBgn)
DataChart = Split(FormulaSrs, ",")
SerieName=DataChart (0)
xValues=DataChart (1)
yValues=DataChart (2)
PlotOrder=DataChart (3)
end with

"Ed Hamilton" wrote in message
et...
In a VB application I'm trying to obtain the x and y data ranges for

each
member of the seriescollection on a floating chart.

In my test case I can identify all the way down to the
SeriesCollection.count and then identify each of the four series by name
(Q1,Q2,Q3,Q4). I thought I had the code for obtaining the values of the
Series but keep getting an error.

The code I can't get is:

ActiveChart.SeriesCollection(1).xvalues

and it passes the "Run-time error '13': Type Mismatch"

Any ideas would be appreciated as it seems this is the correct code.

Ed








All times are GMT +1. The time now is 05:06 AM.

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