Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
Ben Ben is offline
external usenet poster
 
Posts: 509
Default Unable to set the XValues property of the Series class

Hi,

I'm using a xlXYScatter chart with 3 series. When I try to assign
the Xarray with 200 values to the XValues like this:

objChart.SeriesCollection(1).XValues = Xarray

I got the following error:
Unable to set the XValues property of the Series class

I have the chart embeded in an OLE control on a VB form.

Please Help.
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default Unable to set the XValues property of the Series class

You've run into the limit on the number of characters which can be used to
describe the .values and .xvalues, which is around 253 (no, not 255 or 256).
200 values plus 199 commas is 399 characters, and that's if the values are
all single digit.

Dump the values into a worksheet range and use this range as the chart's
source data range.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"Ben" wrote in message
...
Hi,

I'm using a xlXYScatter chart with 3 series. When I try to assign
the Xarray with 200 values to the XValues like this:

objChart.SeriesCollection(1).XValues = Xarray

I got the following error:
Unable to set the XValues property of the Series class

I have the chart embeded in an OLE control on a VB form.

Please Help.
Thanks



  #3   Report Post  
Posted to microsoft.public.excel.charting
Ben Ben is offline
external usenet poster
 
Posts: 509
Default Unable to set the XValues property of the Series class

Thank you Jon,

On my VB6 form I have a chart embeded in an OLE, do you know how to access
the data sheet to dump the values using code?

Thank you.

"Jon Peltier" wrote:

You've run into the limit on the number of characters which can be used to
describe the .values and .xvalues, which is around 253 (no, not 255 or 256).
200 values plus 199 commas is 399 characters, and that's if the values are
all single digit.

Dump the values into a worksheet range and use this range as the chart's
source data range.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"Ben" wrote in message
...
Hi,

I'm using a xlXYScatter chart with 3 series. When I try to assign
the Xarray with 200 values to the XValues like this:

objChart.SeriesCollection(1).XValues = Xarray

I got the following error:
Unable to set the XValues property of the Series class

I have the chart embeded in an OLE control on a VB form.

Please Help.
Thanks




  #4   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default Unable to set the XValues property of the Series class

It's not just the chart that's embedded, right? It should be a workbook with
a chart sheet visible. If there's no worksheet, you'll have to add one.

How are you addressing the chart currently?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ben" wrote in message
...
Thank you Jon,

On my VB6 form I have a chart embeded in an OLE, do you know how to access
the data sheet to dump the values using code?

Thank you.

"Jon Peltier" wrote:

You've run into the limit on the number of characters which can be used
to
describe the .values and .xvalues, which is around 253 (no, not 255 or
256).
200 values plus 199 commas is 399 characters, and that's if the values
are
all single digit.

Dump the values into a worksheet range and use this range as the chart's
source data range.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"Ben" wrote in message
...
Hi,

I'm using a xlXYScatter chart with 3 series. When I try to assign
the Xarray with 200 values to the XValues like this:

objChart.SeriesCollection(1).XValues = Xarray

I got the following error:
Unable to set the XValues property of the Series class

I have the chart embeded in an OLE control on a VB form.

Please Help.
Thanks






  #5   Report Post  
Posted to microsoft.public.excel.charting
Ben Ben is offline
external usenet poster
 
Posts: 509
Default Unable to set the XValues property of the Series class


Hi Jon,

It is a chart embeded, when I edit it I have a Workbook with 2 sheets one
called
Chart1 with the chart and an other one called Sheet1 with data.
Here is the code I'm using to access the chart.

Dim objChart As Object
Set objChart = OLE1.object.ActiveChart

With objChart
.Type = xlXYScatter
.HasTitle = True
.SeriesCollection(1).Name = "=""Serie1"""
.SeriesCollection(1).XValues = XArray1
.SeriesCollection(1).Values = YArray1
.SeriesCollection(2).Name = "=""Serie2"""
.SeriesCollection(2).XValues = XArray2
.SeriesCollection(2).Values = YArray2
.....
End with

Ben
Thanks.


"Jon Peltier" wrote:

It's not just the chart that's embedded, right? It should be a workbook with
a chart sheet visible. If there's no worksheet, you'll have to add one.

How are you addressing the chart currently?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ben" wrote in message
...
Thank you Jon,

On my VB6 form I have a chart embeded in an OLE, do you know how to access
the data sheet to dump the values using code?

Thank you.

"Jon Peltier" wrote:

You've run into the limit on the number of characters which can be used
to
describe the .values and .xvalues, which is around 253 (no, not 255 or
256).
200 values plus 199 commas is 399 characters, and that's if the values
are
all single digit.

Dump the values into a worksheet range and use this range as the chart's
source data range.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"Ben" wrote in message
...
Hi,

I'm using a xlXYScatter chart with 3 series. When I try to assign
the Xarray with 200 values to the XValues like this:

objChart.SeriesCollection(1).XValues = Xarray

I got the following error:
Unable to set the XValues property of the Series class

I have the chart embeded in an OLE control on a VB form.

Please Help.
Thanks








  #6   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default Unable to set the XValues property of the Series class

Ben -

What & where is the data on the worksheet?

I'm a little rusty, but it should go something like the following. Adjust
the ranges if there's a risk of overwriting anything important on Sheet1.
Also I am assuming the arrays are one dimensional.

Dim objChart As Object
Dim objWksht As Object ' or as Excel.Worksheet if early binding
Dim rngX1 As Object ' or as Excel.Range
Dim rngY1 As Object ' or as Excel.Range
Dim rngX2 As Object ' or as Excel.Range
Dim rngY2 As Object ' or as Excel.Range

Set objChart = OLE1.object.ActiveChart
Set objWksht = OLE1.Object.Worksheets("Sheet1")

' populate ranges with array data
With objWksht
Set rngX1 =
objWksht.Range("A1").Resize(UBound(XArray1)+1-LBound(XArray1))
rngX1.Value = .Application.WorksheetFunction.Transpose(XArray1)

Set rngY1 =
objWksht.Range("B1").Resize(UBound(YArray1)+1-LBound(YArray1))
rngY1.Value = .Application.WorksheetFunction.Transpose(YArray1)

Set rngX2 =
objWksht.Range("D1").Resize(UBound(XArray2)+1-LBound(XArray2))
rngX21.Value = .Application.WorksheetFunction.Transpose(XArray2)

Set rngY2 =
objWksht.Range("E1").Resize(UBound(YArray2)+1-LBound(YArray2))
rngY2.Value = .Application.WorksheetFunction.Transpose(YArray2)
End With

' populate chart series from ranges
With objChart
.Type = xlXYScatter
.HasTitle = True
.SeriesCollection(1).Name = "=""Serie1"""
.SeriesCollection(1).XValues = rngX1 ' XArray1
.SeriesCollection(1).Values = rngY1 ' YArray1
.SeriesCollection(2).Name = "=""Serie2"""
.SeriesCollection(2).XValues = rngX2 ' XArray2
.SeriesCollection(2).Values = rngY2 ' YArray2
'....
End with


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ben" wrote in message
...

Hi Jon,

It is a chart embeded, when I edit it I have a Workbook with 2 sheets one
called
Chart1 with the chart and an other one called Sheet1 with data.
Here is the code I'm using to access the chart.

Dim objChart As Object
Set objChart = OLE1.object.ActiveChart

With objChart
.Type = xlXYScatter
.HasTitle = True
.SeriesCollection(1).Name = "=""Serie1"""
.SeriesCollection(1).XValues = XArray1
.SeriesCollection(1).Values = YArray1
.SeriesCollection(2).Name = "=""Serie2"""
.SeriesCollection(2).XValues = XArray2
.SeriesCollection(2).Values = YArray2
....
End with

Ben
Thanks.


"Jon Peltier" wrote:

It's not just the chart that's embedded, right? It should be a workbook
with
a chart sheet visible. If there's no worksheet, you'll have to add one.

How are you addressing the chart currently?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ben" wrote in message
...
Thank you Jon,

On my VB6 form I have a chart embeded in an OLE, do you know how to
access
the data sheet to dump the values using code?

Thank you.

"Jon Peltier" wrote:

You've run into the limit on the number of characters which can be
used
to
describe the .values and .xvalues, which is around 253 (no, not 255 or
256).
200 values plus 199 commas is 399 characters, and that's if the values
are
all single digit.

Dump the values into a worksheet range and use this range as the
chart's
source data range.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"Ben" wrote in message
...
Hi,

I'm using a xlXYScatter chart with 3 series. When I try to assign
the Xarray with 200 values to the XValues like this:

objChart.SeriesCollection(1).XValues = Xarray

I got the following error:
Unable to set the XValues property of the Series class

I have the chart embeded in an OLE control on a VB form.

Please Help.
Thanks








  #7   Report Post  
Posted to microsoft.public.excel.charting
Ben Ben is offline
external usenet poster
 
Posts: 509
Default Unable to set the XValues property of the Series class

Thank you very much.

You're wonderful.

It is working perfect.

Thanks again.

"Jon Peltier" wrote:

Ben -

What & where is the data on the worksheet?

I'm a little rusty, but it should go something like the following. Adjust
the ranges if there's a risk of overwriting anything important on Sheet1.
Also I am assuming the arrays are one dimensional.

Dim objChart As Object
Dim objWksht As Object ' or as Excel.Worksheet if early binding
Dim rngX1 As Object ' or as Excel.Range
Dim rngY1 As Object ' or as Excel.Range
Dim rngX2 As Object ' or as Excel.Range
Dim rngY2 As Object ' or as Excel.Range

Set objChart = OLE1.object.ActiveChart
Set objWksht = OLE1.Object.Worksheets("Sheet1")

' populate ranges with array data
With objWksht
Set rngX1 =
objWksht.Range("A1").Resize(UBound(XArray1)+1-LBound(XArray1))
rngX1.Value = .Application.WorksheetFunction.Transpose(XArray1)

Set rngY1 =
objWksht.Range("B1").Resize(UBound(YArray1)+1-LBound(YArray1))
rngY1.Value = .Application.WorksheetFunction.Transpose(YArray1)

Set rngX2 =
objWksht.Range("D1").Resize(UBound(XArray2)+1-LBound(XArray2))
rngX21.Value = .Application.WorksheetFunction.Transpose(XArray2)

Set rngY2 =
objWksht.Range("E1").Resize(UBound(YArray2)+1-LBound(YArray2))
rngY2.Value = .Application.WorksheetFunction.Transpose(YArray2)
End With

' populate chart series from ranges
With objChart
.Type = xlXYScatter
.HasTitle = True
.SeriesCollection(1).Name = "=""Serie1"""
.SeriesCollection(1).XValues = rngX1 ' XArray1
.SeriesCollection(1).Values = rngY1 ' YArray1
.SeriesCollection(2).Name = "=""Serie2"""
.SeriesCollection(2).XValues = rngX2 ' XArray2
.SeriesCollection(2).Values = rngY2 ' YArray2
'....
End with


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ben" wrote in message
...

Hi Jon,

It is a chart embeded, when I edit it I have a Workbook with 2 sheets one
called
Chart1 with the chart and an other one called Sheet1 with data.
Here is the code I'm using to access the chart.

Dim objChart As Object
Set objChart = OLE1.object.ActiveChart

With objChart
.Type = xlXYScatter
.HasTitle = True
.SeriesCollection(1).Name = "=""Serie1"""
.SeriesCollection(1).XValues = XArray1
.SeriesCollection(1).Values = YArray1
.SeriesCollection(2).Name = "=""Serie2"""
.SeriesCollection(2).XValues = XArray2
.SeriesCollection(2).Values = YArray2
....
End with

Ben
Thanks.


"Jon Peltier" wrote:

It's not just the chart that's embedded, right? It should be a workbook
with
a chart sheet visible. If there's no worksheet, you'll have to add one.

How are you addressing the chart currently?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ben" wrote in message
...
Thank you Jon,

On my VB6 form I have a chart embeded in an OLE, do you know how to
access
the data sheet to dump the values using code?

Thank you.

"Jon Peltier" wrote:

You've run into the limit on the number of characters which can be
used
to
describe the .values and .xvalues, which is around 253 (no, not 255 or
256).
200 values plus 199 commas is 399 characters, and that's if the values
are
all single digit.

Dump the values into a worksheet range and use this range as the
chart's
source data range.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"Ben" wrote in message
...
Hi,

I'm using a xlXYScatter chart with 3 series. When I try to assign
the Xarray with 200 values to the XValues like this:

objChart.SeriesCollection(1).XValues = Xarray

I got the following error:
Unable to set the XValues property of the Series class

I have the chart embeded in an OLE control on a VB form.

Please Help.
Thanks









  #8   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default Unable to set the XValues property of the Series class

Glad to help.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ben" wrote in message
...
Thank you very much.

You're wonderful.

It is working perfect.

Thanks again.

"Jon Peltier" wrote:

Ben -

What & where is the data on the worksheet?

I'm a little rusty, but it should go something like the following. Adjust
the ranges if there's a risk of overwriting anything important on Sheet1.
Also I am assuming the arrays are one dimensional.

Dim objChart As Object
Dim objWksht As Object ' or as Excel.Worksheet if early binding
Dim rngX1 As Object ' or as Excel.Range
Dim rngY1 As Object ' or as Excel.Range
Dim rngX2 As Object ' or as Excel.Range
Dim rngY2 As Object ' or as Excel.Range

Set objChart = OLE1.object.ActiveChart
Set objWksht = OLE1.Object.Worksheets("Sheet1")

' populate ranges with array data
With objWksht
Set rngX1 =
objWksht.Range("A1").Resize(UBound(XArray1)+1-LBound(XArray1))
rngX1.Value = .Application.WorksheetFunction.Transpose(XArray1)

Set rngY1 =
objWksht.Range("B1").Resize(UBound(YArray1)+1-LBound(YArray1))
rngY1.Value = .Application.WorksheetFunction.Transpose(YArray1)

Set rngX2 =
objWksht.Range("D1").Resize(UBound(XArray2)+1-LBound(XArray2))
rngX21.Value = .Application.WorksheetFunction.Transpose(XArray2)

Set rngY2 =
objWksht.Range("E1").Resize(UBound(YArray2)+1-LBound(YArray2))
rngY2.Value = .Application.WorksheetFunction.Transpose(YArray2)
End With

' populate chart series from ranges
With objChart
.Type = xlXYScatter
.HasTitle = True
.SeriesCollection(1).Name = "=""Serie1"""
.SeriesCollection(1).XValues = rngX1 ' XArray1
.SeriesCollection(1).Values = rngY1 ' YArray1
.SeriesCollection(2).Name = "=""Serie2"""
.SeriesCollection(2).XValues = rngX2 ' XArray2
.SeriesCollection(2).Values = rngY2 ' YArray2
'....
End with


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ben" wrote in message
...

Hi Jon,

It is a chart embeded, when I edit it I have a Workbook with 2 sheets
one
called
Chart1 with the chart and an other one called Sheet1 with data.
Here is the code I'm using to access the chart.

Dim objChart As Object
Set objChart = OLE1.object.ActiveChart

With objChart
.Type = xlXYScatter
.HasTitle = True
.SeriesCollection(1).Name = "=""Serie1"""
.SeriesCollection(1).XValues = XArray1
.SeriesCollection(1).Values = YArray1
.SeriesCollection(2).Name = "=""Serie2"""
.SeriesCollection(2).XValues = XArray2
.SeriesCollection(2).Values = YArray2
....
End with

Ben
Thanks.


"Jon Peltier" wrote:

It's not just the chart that's embedded, right? It should be a
workbook
with
a chart sheet visible. If there's no worksheet, you'll have to add
one.

How are you addressing the chart currently?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ben" wrote in message
...
Thank you Jon,

On my VB6 form I have a chart embeded in an OLE, do you know how to
access
the data sheet to dump the values using code?

Thank you.

"Jon Peltier" wrote:

You've run into the limit on the number of characters which can be
used
to
describe the .values and .xvalues, which is around 253 (no, not 255
or
256).
200 values plus 199 commas is 399 characters, and that's if the
values
are
all single digit.

Dump the values into a worksheet range and use this range as the
chart's
source data range.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"Ben" wrote in message
...
Hi,

I'm using a xlXYScatter chart with 3 series. When I try to assign
the Xarray with 200 values to the XValues like this:

objChart.SeriesCollection(1).XValues = Xarray

I got the following error:
Unable to set the XValues property of the Series class

I have the chart embeded in an OLE control on a VB form.

Please Help.
Thanks











Reply
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
Unable to set the Values property of the Series class rafael garcia Charts and Charting in Excel 1 September 25th 06 04:31 PM
Unable to set the formula property of the series class Malhar Charts and Charting in Excel 1 July 24th 06 05:50 PM
How to cycle through each of property and its value of Class? Tetsuya Oguma Excel Worksheet Functions 1 March 3rd 06 10:36 AM
Unable to set the XValues property of the Series class ramkumar_cpt Charts and Charting in Excel 5 November 29th 05 02:13 PM
VBA error: Unable to set the Values property of the Series class Marco Shaw Charts and Charting in Excel 1 July 12th 05 02:34 PM


All times are GMT +1. The time now is 09:35 PM.

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"