LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel get data returns empty string

I am trying to write a VI that reads a specific cell from the last row of an excel spreadsheet (.xlsx). I have written the VI shown in the screenshot. It is able to pull the row number of the last row in the spreadsheet. I then bundle this back into a cluster with the column number set to 3, i.e. column D. This should be a 16 digit string. 

 

When I use this cluster as the 'start' input of the 'get data' vi, it doesn't return anything. I have tried changing the data type input to empty strings or different string constants, but it still returns nothing. 

 

The only example for this that I could find online uses an old version of labview (I believe 2012) and the 'get data' vi has two coordinate inputs - one for start position and one for end position. But the latest version only has start.

 

Can anyone explain why I'm unable to return the data I want here?

Capture.PNG

 

0 Kudos
Message 1 of 3
(748 Views)

Decrement  the row by one coming from get last row it will work. 

image.png

0 Kudos
Message 2 of 3
(703 Views)

The problems is because the function MS Office Parameters Out the last row of the excel file (In my example it has three rows, returns 3). However the function GET Excel Data requires the INDEX of the cell starting from ZERO. So when you run GET Excel Data it will return the content of the cell line index =3 (fouth line) that is empty, and it returns empty string. 

 

To correct this you need to add a decrement. 

 

LVNinja_1-1690980461688.png

 

LVNinja_2-1690980605728.png

 

 

 

0 Kudos
Message 3 of 3
(696 Views)