Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How Can I return the XValues of the Series collection object ? | Excel Programming | |||
Unable to Set the XValues Property of the Series | Charts and Charting in Excel | |||
Unable to Set XValues property of the Series class | Excel Programming | |||
Problem adding Series XValues to Chart using VBA | Charts and Charting in Excel | |||
Unable to set the XValues property of the Series class | Excel Programming |