LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ActiveX - change limits in Excel sheet

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?

Download All
0 Kudos
Message 1 of 13
(2,880 Views)

What are the inputs to the VI generating the error when the error occurs?

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 13
(2,869 Views)

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?

 

0 Kudos
Message 3 of 13
(2,849 Views)

If you run the code with execution highlighting turned on, where exactly does the error occur?

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 13
(2,840 Views)

See attached for the flow of errors.

 

 

Download All
0 Kudos
Message 5 of 13
(2,836 Views)

Right off hand I would say that the index input should be a number and not a string ("Measurement").

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 6 of 13
(2,809 Views)

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!

0 Kudos
Message 7 of 13
(2,805 Views)

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?

0 Kudos
Message 8 of 13
(2,799 Views)

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

Message 9 of 13
(2,778 Views)

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.

Download All
0 Kudos
Message 10 of 13
(2,774 Views)