Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 125
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.programming
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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default 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






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 125
Default 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




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
How Can I return the XValues of the Series collection object ? Dan Thompson Excel Programming 10 April 24th 09 09:37 PM
Unable to Set the XValues Property of the Series KathyC Charts and Charting in Excel 5 January 4th 07 09:26 PM
Unable to Set XValues property of the Series class PGalla06[_18_] Excel Programming 0 September 30th 05 04:16 PM
Problem adding Series XValues to Chart using VBA Sean Curry Charts and Charting in Excel 0 March 14th 05 12:18 AM
Unable to set the XValues property of the Series class David Mullins via OfficeKB.com Excel Programming 0 January 26th 05 02:54 PM


All times are GMT +1. The time now is 12:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"