Hi everybody "I need help" regarding multicolumn listbox in Labview, I want to Save my data in excel type and the save Data Should be thesame in What is on Lisbox. How do I begin? Please any Idea?
LabVIEW Version: Labview 2012
Solved! Go to Solution.
For writing data to excel , you can use spreadsheet functions (write to spreadsheet.vi) . Input to this function will be the 1d/2d array which will be nothing but the elements in your listbox.
For getting the elements of the list box you can use property node with the property "ItemNames" from where you can get all the elements present in the listbox.
Hope this helps!!!
Ok Sir, Let me try..
Thanks Sir. it Works
I stumbled upon this post while looking on methods to save data in excel file. I've tried using the write to spreadsheet file VI by wiring from the multicolumn listbox to the 2D data channel. I was asked to choose a file to write to and I selected an empty sheet of excel file. However, after running my codes I was unable to open the excel file as there is an error as stated in the snippet attached.
Write to Spreadsheet File does NOT create an Excel file. It creates a text file where the elements and rows are separated by delimiters (typically commas or tabs for columns, end of line characters for rows). It is a huge mistake to give the file the extension of .xls or .xlsx because it is not an Excel file and you are lying to Excel about how to open it, particularly .xlsx because Excel is expecting to see a file that meets its XML file format.
You should label the file as .txt or .csv. When you open those using Excel, it will actually import the text file (as opposed to opening it) into Excel.
Thank you for pointing that to me. I never knew that I'm not supposed to save in .xlx or .xlsx files. Now that I've tried saving in .txt I manage to get all the data but the column headers were not saved. Is there a way to get the headers in the .txt file as well?
Use a property node to get an array that consists of the column headers. (1-D array of strings).
Use another write to spreadsheet file and wire that column header array into the 1-D array input. Then wire the data as you are doing now into the Write to Spreadsheet File but be sure you have a True constant wire to append data.
I want to do the same, save my MultiColumn Listbox data into Excel, but incluiding the format of each "cell". My table has different colors depending on the data.
Any idea in how to do it?
Im using Labview 2018.
I attached an example of the data on my multicolumn list box.
use RGT (ReportGenerationToolkit) functions to transfer the MCLB data to a spreadsheet and also to set colors of the Excel cells.
As soon as you want to use Excel-specific features (like colors, borders, cell formatting at all) you need to work with "real" Excel files. You cannot use spreadsheet files (like CSV) anymore…