LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get data from an existing Excel file using report generation toolkit

Solved!
Go to solution

If, instead of using Excel Easy Text, you use Excel Easy Table, the formatting that you may have place on the Excel WorkSheet is not altered by writing new data.

 

We use a very colorful Excel WorkBook to control a Behavioral Experiment.  Each Row represents a Trial, and there are over 100 columns of parameters (two dozen are "output" columns where selected data are written at the end of each trial).  To visually manage such a large sheet, we've designed it so that related columns are color-coded (background) -- purple, pink, and green for pre-trial movements, yellow for pre-trial lasers, blue for push-button control, etc.  During the Experiment, we read rows sequentially, each row governing a Trial.  Neither Reading a row nor writing out (using Excel Easy Table) changes the formatting of the cells in any way.

 

One thing we do want to change is the appearance of the "Active" row.  We do this by applying formatting to change the numbers in that row from Black to Red (so the Experimenter know which row is being used).  Here's the code to do that:

Red One Row.png

[We run an analogous routine to turn it back to Black].  There is a little ActiveX "magic" hidden in the Row Limits function, which takes the start of the row and returns the start and end of the row.  You should be able to guess what Row++ does ...

 

Bob Schor

0 Kudos
Message 21 of 25
(1,534 Views)

Hallo again.
I got sick so I been ofline for som days. 
I thing the format changes. The backgrund color of the cells is made white and border lines i put in:

 

 

Capture.PNG

0 Kudos
Message 22 of 25
(1,507 Views)

Now I succeeded removing border and background color.

When setting font it’s possible to set it unchanged.
I would have been nice to have the same opportunity with border and background color.

Maybe in next version of labview ?

snip.png

0 Kudos
Message 23 of 25
(1,502 Views)

Probably not.  NI has provided a method to create simple reports in Excel (and in Word, and in HTML), and has provided tools that let you get "fancier", though that is not the main mission of LabVIEW (which is to be a Laboratory Virtual Instrument Engineering Workbench).

 

Bob Schor

0 Kudos
Message 24 of 25
(1,498 Views)

I made this VI, which allows you to open an Excel workbook, and load each sheet into a separate table.

You can edit the table (sheets) and in the end save the workbook.

0 Kudos
Message 25 of 25
(1,271 Views)