This works:How can I fill the array directly with values(read from file, NOT via cellvalues), and then use it in a chart?Please Login or Register to view this content.
This works:How can I fill the array directly with values(read from file, NOT via cellvalues), and then use it in a chart?Please Login or Register to view this content.
If I understand what you are asking, the .values property of a series object can be an array constant instead of a range reference. See example here: https://msdn.microsoft.com/en-us/lib.../ff197014.aspx
Can I assume you know how to load the values you have from whatever source you have identified into an array, or do you also need help with that step?
Originally Posted by shg
Yes, I can fill the array with data from a file, like thisBut 'With ActiveChart.FullSeriesCollection(1): .Values = vArrayFromFile(): End With' doesn't work. So the array must be filled differently?Please Login or Register to view this content.
Last edited by Woulter; 10-25-2016 at 04:37 PM.
In what way does it not work? Is it giving a compiler error? runtime error? other error? running but doing the wrong thing?
The only thing I can see about how you are loadiing the array is that the elements of strarrstring() will be text strings (numbers stored as text). Excel charts treat text strings (including numbers stored as text) as 0. You may need a val() function or similar in there to coerce the numbers as text into real numbersPlease Login or Register to view this content.
It worked, but is there a limit to how many datapoints that can put in the array(32000)?
I am not aware of any limits. The official published limits are that you are only limited by available memory. There might be an unpublished character limit to the =SERIES() "function" that defines a charts data series (which will need to include the entire array constant), you will probably have to give it a try and see if you bump up against such a limit. In that case, you can always write the values to a range in the sheet, or write them to a named array constant.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks