02-16-2012 03:27 PM
I'm having trouble with changing the limits in an excel chart contained in a known sheet.
The code displayed in the attachment is supposed to navigate to the correct sheet, then pick the chart on that sheet and set the X and Y limits.
However I receive an error upon running the code.
Ideas?
02-16-2012 04:22 PM
What are the inputs to the VI generating the error when the error occurs?
Mike...
02-21-2012 07:38 AM
Hi,
I'm not sure what input you're referring to, but perhaps it helps to say that the VI also writes data to an excel file and saves it *without trouble*.
You'll see in the attached picture that I actually put this "Change Axes" code as an insert into working code which does the above tasks (write+save).
Does that help?
02-21-2012 08:04 AM
If you run the code with execution highlighting turned on, where exactly does the error occur?
Mike...
02-21-2012 08:14 AM
See attached for the flow of errors.
02-22-2012 08:28 AM
Right off hand I would say that the index input should be a number and not a string ("Measurement").
Mike...
02-22-2012 08:38 AM
I don't believe that's true, since a string is required in another part of the VI. I'm quite certain that a string containing the exact name of the sheet is required.
The problem, it seems, is somewhere else.
any other ideas?
Thanks!
02-22-2012 08:54 AM
The problem may be:
I only have 1 chart on the sheet, but regardless, how does the VI know which "Excel_Chart" I'm referring to? Could that be a part of the problem?
02-22-2012 10:19 AM
There is no problem in using the sheet name as index. I think the issue here is that your chart is part of a standard sheet and your code refer to a chart sheet. The wokbook ->charts property return the collection of the workbook chart sheets. You then use Measurement as index of a chart sheet, since it doesn't exist it throws an error.
Ben64
02-22-2012 11:21 AM
Great observation re: the chart being in its own sheet.
In my application I need the chart as an object in a typical sheet.
However I tried placing the chart in its own sheet and the error has changed. Take a look at the attached.
Thanks for any thoughts.