LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I exit a while loop which has a 'read from spreadsheet' pop up in it?

I have a while loop which calls 'read from spreadsheet'. My problem is that after entering a filename the loop repeats too quickly for me to hit the end loop button. How do I exit the loop without adding a delay after the read thereby slowing the loop when I don't want to exit. If I select cancel I get 'error 43'. Is there a way to to use an error handler to prevent this from popping up and use it to end the loop?
0 Kudos
Message 1 of 4
(2,854 Views)
It's the error handler inside Read From Spreadsheet that creates the message. Specifically, one of the VIs called is Read Lines From File. The last VI in there is General Error Handler. You can delete it and save it with a different name. You should also modify it to return the error cluster. You'll also want to modify Read From Spreadsheet to return the error cluster so that you can trap the error in your VI. When cancel is selected, error code 43 is generated. Stop the loop when you see 43.
0 Kudos
Message 2 of 4
(2,854 Views)
Thank you for this. I think I can do that but would prefer a solution that didn't involve modifying the three levels of vi's to do it.
0 Kudos
Message 3 of 4
(2,854 Views)
"nrcan" wrote in message
news:506500000005000000B7CD0000-1042324653000@exchange.ni.com...
> Thank you for this. I think I can do that but would prefer a solution
> that didn't involve modifying the three levels of vi's to do it.

You might prefer to use the excel toolkit that you can download from the NI
website (if you have excel). It's free and much more powerful. Takes a
little getting used to but well worth it.
0 Kudos
Message 4 of 4
(2,854 Views)