ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Extracting XValues Formula string From Series collection ? (https://www.excelbanter.com/excel-programming/427274-extracting-xvalues-formula-string-series-collection.html)

Dan Thompson

Extracting XValues Formula string From Series collection ?
 
This is very frustrating I currently have this code

Sub Test()
Dim X
X = ActiveChart.SeriesCollection(1).Formula
Debug.Print X
End Sub

The above code works fine and outputs
=SERIES("MyChart",data!$FK$597:$FK$638,data!$FJ$59 7:$FJ$639,1)
which is what I want however ........

When I try this code

Sub Test()
Dim B
B = ActiveChart.SeriesCollection(1).XValues.Formula
Debug.Print B
End Sub

I get a runtime error 424 Object Requiered

What am I doing wrong Surely there is a method to return the formula string
value of the XValues of a chart series ??

Dan Thompson

Patrick Molloy[_2_]

Extracting XValues Formula string From Series collection ?
 
agreed, quite odd, but i guess there's some logic behind the object model
if you break at the debug line and look at xy in the watch window you'll see
that it's of type 'string' and looking at cl in the watch window, cl.xyvalues
is a collection of strings...i see no formula here

i suspect that the formula that you want is buried in the chart object
somewhere though

Sub Test()
Dim cl As Series, xy 'As Object
Set cl = ActiveChart.SeriesCollection(1)
For Each xy In cl.XValues
Debug.Print xy
Next
End Sub

"Dan Thompson" wrote:

This is very frustrating I currently have this code

Sub Test()
Dim X
X = ActiveChart.SeriesCollection(1).Formula
Debug.Print X
End Sub

The above code works fine and outputs
=SERIES("MyChart",data!$FK$597:$FK$638,data!$FJ$59 7:$FJ$639,1)
which is what I want however ........

When I try this code

Sub Test()
Dim B
B = ActiveChart.SeriesCollection(1).XValues.Formula
Debug.Print B
End Sub

I get a runtime error 424 Object Requiered

What am I doing wrong Surely there is a method to return the formula string
value of the XValues of a chart series ??

Dan Thompson


Peter T

Extracting XValues Formula string From Series collection ?
 
What is it that you are trying to do that I haven't already shown you how to
do in your other threads.

Regards,
Peter T


"Dan Thompson" wrote in message
...
This is very frustrating I currently have this code

Sub Test()
Dim X
X = ActiveChart.SeriesCollection(1).Formula
Debug.Print X
End Sub

The above code works fine and outputs
=SERIES("MyChart",data!$FK$597:$FK$638,data!$FJ$59 7:$FJ$639,1)
which is what I want however ........

When I try this code

Sub Test()
Dim B
B = ActiveChart.SeriesCollection(1).XValues.Formula
Debug.Print B
End Sub

I get a runtime error 424 Object Requiered

What am I doing wrong Surely there is a method to return the formula
string
value of the XValues of a chart series ??

Dan Thompson




Peter T

Extracting XValues Formula string From Series collection ?
 
i suspect that the formula that you want is buried in the chart object
somewhere though


It's not buried, the XValues is the second section of the formula
The above code works fine and outputs
=SERIES("MyChart",data!$FK$597:$FK$638,data!$FJ$59 7:$FJ$639,1)


It's simple to make that a range object, assuming the XValues are sourced to
cells (as demonstrated in other threads)

cl.xvalues is a collection of strings...


It's an array of values

Regards,
Peter T

"Patrick Molloy" wrote in message
...
agreed, quite odd, but i guess there's some logic behind the object model
if you break at the debug line and look at xy in the watch window you'll
see
that it's of type 'string' and looking at cl in the watch window,
cl.xyvalues
is a collection of strings...i see no formula here

i suspect that the formula that you want is buried in the chart object
somewhere though

Sub Test()
Dim cl As Series, xy 'As Object
Set cl = ActiveChart.SeriesCollection(1)
For Each xy In cl.XValues
Debug.Print xy
Next
End Sub

"Dan Thompson" wrote:

This is very frustrating I currently have this code

Sub Test()
Dim X
X = ActiveChart.SeriesCollection(1).Formula
Debug.Print X
End Sub

The above code works fine and outputs
=SERIES("MyChart",data!$FK$597:$FK$638,data!$FJ$59 7:$FJ$639,1)
which is what I want however ........

When I try this code

Sub Test()
Dim B
B = ActiveChart.SeriesCollection(1).XValues.Formula
Debug.Print B
End Sub

I get a runtime error 424 Object Requiered

What am I doing wrong Surely there is a method to return the formula
string
value of the XValues of a chart series ??

Dan Thompson




Patrick Molloy[_2_]

Extracting XValues Formula string From Series collection ?
 
ok

"Peter T" wrote:

i suspect that the formula that you want is buried in the chart object
somewhere though


It's not buried, the XValues is the second section of the formula
The above code works fine and outputs
=SERIES("MyChart",data!$FK$597:$FK$638,data!$FJ$59 7:$FJ$639,1)


It's simple to make that a range object, assuming the XValues are sourced to
cells (as demonstrated in other threads)

cl.xvalues is a collection of strings...


It's an array of values

Regards,
Peter T

"Patrick Molloy" wrote in message
...
agreed, quite odd, but i guess there's some logic behind the object model
if you break at the debug line and look at xy in the watch window you'll
see
that it's of type 'string' and looking at cl in the watch window,
cl.xyvalues
is a collection of strings...i see no formula here

i suspect that the formula that you want is buried in the chart object
somewhere though

Sub Test()
Dim cl As Series, xy 'As Object
Set cl = ActiveChart.SeriesCollection(1)
For Each xy In cl.XValues
Debug.Print xy
Next
End Sub

"Dan Thompson" wrote:

This is very frustrating I currently have this code

Sub Test()
Dim X
X = ActiveChart.SeriesCollection(1).Formula
Debug.Print X
End Sub

The above code works fine and outputs
=SERIES("MyChart",data!$FK$597:$FK$638,data!$FJ$59 7:$FJ$639,1)
which is what I want however ........

When I try this code

Sub Test()
Dim B
B = ActiveChart.SeriesCollection(1).XValues.Formula
Debug.Print B
End Sub

I get a runtime error 424 Object Requiered

What am I doing wrong Surely there is a method to return the formula
string
value of the XValues of a chart series ??

Dan Thompson





Dan Thompson

Extracting XValues Formula string From Series collection ?
 
Sorry agian for the confusion Peter I have figured out the issue on this
XValues thing now. The confusion was do to my lack of understanding

I was trying to use the .formual property to return a range string from the
XValues which I now know doesn't work because XValues can only return an
values or named array not a range.

It's not buried, the XValues is the second section of the formula

I know get your above statement i did not realize about that before do to my
novice'ness





"Peter T" wrote:

What is it that you are trying to do that I haven't already shown you how to
do in your other threads.

Regards,
Peter T


"Dan Thompson" wrote in message
...
This is very frustrating I currently have this code

Sub Test()
Dim X
X = ActiveChart.SeriesCollection(1).Formula
Debug.Print X
End Sub

The above code works fine and outputs
=SERIES("MyChart",data!$FK$597:$FK$638,data!$FJ$59 7:$FJ$639,1)
which is what I want however ........

When I try this code

Sub Test()
Dim B
B = ActiveChart.SeriesCollection(1).XValues.Formula
Debug.Print B
End Sub

I get a runtime error 424 Object Requiered

What am I doing wrong Surely there is a method to return the formula
string
value of the XValues of a chart series ??

Dan Thompson






All times are GMT +1. The time now is 01:15 PM.

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