Slow Graphs

Local time
Today, 13:32
Joined
Oct 6, 2004
Messages
15
I wrote some VBA code to populate a graph in a form. It works fine, but is incredibly slow. In the program, I make an array of data points (2 by approx. 1000). This goes pretty fast - done in a second or two. Then I want to take this array and make an XY-scatter plot out of it. I have a graph made with all of the settings I like and all I do is fill in the datasheet with values from the array. This takes a rediculously long time considering it's not calculating anything, on the order of 5 to 10 minutes. I know there must be a faster way to do this. To populate my graph, I have code like this:

For I% = 1 to 1000
MyGraph.Application.DataSheet.Range("'0" & I% & "'").Value = MyArray(I%,1)
MyGraph.Application.DataSheet.Range("'A" & I% & "'").Value = MyArray(I%,2)
Next I%

What I thought might speed this up was if I input a group of data, like .Range("A1:A1000").Value = ?
Is there a way to output a group of values from an array? MyArray(1:1000,2) doesn't work for me. Then again, that might not even speed things up. If anybody has come accross this problem or knows of a possible solution, please let me know.
 

Users who are viewing this thread

Back
Top Bottom