LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

listboax

Hi
 
Greetings!. Recently I face some problem using the listbox in the labview 8.0. My design is grab all the *.xls file in the certain folder (eg: C:\My Documents\labview\) and display it in the listbox(1st step i had successfully done). The 2nd step is I select one of the .xls file in the list box either double click it or "open" buttom, then it will automaticaly list out all the contain in that .xls file (other method is direct open by the excel).
 
Do you guy have any idea how to develop the 2nd step? Please give some advise or example for me as a reference.
Thanks a lot 🙂
 
Regards
Kong Cheng
0 Kudos
Message 1 of 3
(2,516 Views)
If it's a true XLS file, then I can't display it, because the XLS format is proprietary(private) from Microsoft. I don't know if the format is publicly available, but it changes too often anyway.

If you mean a rows & columns TEXT file, then it's simple.

You have an event structure with the following responses to events:

ListBox Value Change:

Use the value of the listbox to index the list of file names, display the result in a separate field called NAME(to show the one you're about to pick).

OPEN button Value Change:

Use the value of the NAME field as your result.

ListBox Double-Click:

If the ROW value (double-clicked row) is less than the number of names in the list (they might have double clicked beyond the end), then Use the value of the NAME field as your result.

This last thing works because your VALUE CHANGE event will occur before the DOUBLE-CLICK event occurs.

Now use this name to open the chosen file.

HTH

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 3
(2,504 Views)
You can use ActiveX to open Excel spreadsheets (provided you have Excel installed).  The examples should be helpful with this.
0 Kudos
Message 3 of 3
(2,501 Views)