View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default 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