Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 747
Default xl2007 - Reading Values and XValues

You cannot to my knowledge directly querry the XValues or Values from a chart
series. For example, this does NOT work:

Sub test1()
Dim i As Integer
With ActiveSheet.ChartObjects(1).Chart.SeriesCollection (1)
For i = LBound(.XValues) To UBound(.XValues)
Debug.Print .XValues(i)
Next
End With
End Sub

However, if you set a variant to the XValues or Values, it returns an
variant array that you can querry. Prior to xl2007, the following code works:

Sub test2()
Dim arr As Variant
Dim i As Integer
With ActiveSheet.ChartObjects(1).Chart.SeriesCollection (1)
arr = .XValues
For i = LBound(arr) To UBound(arr)
Debug.Print arr(i)
Next
End With
End Sub

I have a large project that obtains the XValues and Values using the above
code (formatted as a function). A couple of staff have upgraded to xl2007 and
this code stopped working. I don't have xl2007 to experiment with. Wondering
if anyone knows of a simple alternative that doesn't resort to either parsing
the series formula or using a cell range and reading the cell values? Maybe
using Application.Transpose and reading the return array? Or maybe I'm
missing something?

As mentioned above, I don't have xl2007 to experiment with. Appreciative of
responses.

Greg
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
.Values / .XValues modification baconcow Excel Discussion (Misc queries) 4 September 29th 08 11:06 PM
Reading values from a closed workbook Graham F New Users to Excel 6 July 28th 08 03:32 PM
Displaying XValues and Values for chart using VBA Barb Reinhardt Charts and Charting in Excel 2 January 13th 06 01:34 AM
line of best fit/reading values from graphs Becky Hutchinson Excel Discussion (Misc queries) 4 December 27th 05 06:16 PM
Problem with plotting a chart when using arrays as Values and Xvalues [email protected] Charts and Charting in Excel 3 August 19th 05 09:05 PM


All times are GMT +1. The time now is 10:28 AM.

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"