I am attempting to automate some graphs. My template is 6 graphs on a page, with - at this point - one plot to be plotted on each graph. I am hoping to loop the plots by having the graph object named 1 - 6 and looping through this index I have called "n". I am running into an issue with the following lines in my code:
Graph1.AddLinePlot(Data,6,3,"X Axis 1","Y Axis 1","n") With Graph1.Plots.Item("n")
It appears however, that I cannot have this variable for looping? Instead I must have "1" here so that grapher knows to look for object "1" on my template. Is there a way to have the loop variable as the name of the plot item?
Alternatively, instead of n where n is 1 to 6, I have included a cell reference to my spreadsheet here e.g. "(i,1)" o loop through the i value and therefore the value in my spreadsheet but again this doesn't work.
The error I receive is that the 'object var is nothing' occurring at this code line: Graph1.AddLinePlot(Data,6,3,"X Axis 1","Y Axis 1","n")
Any help is much appreciated.
Please sign in to leave a comment.