LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading First Column of an Excel File Using ActiveX

Solved!
Go to solution

I'm trying to read the first column of an excel document using activex however I'm having trouble getting the program to work. Currently it creates an array that is the length of the first column, but it doesn't populate with the data. Does anyone have any experience with activex and possibly understand what I've done wrong. I cannot upload my excel sheet due to data security policies.

0 Kudos
Message 1 of 10
(458 Views)

Hi Clark,

 


@FordClark001 wrote:

I cannot upload my excel sheet due to data security policies.


You could upload a similar Excel workbook without your "secure" data!

 

And you could upload your VI down-converted for an older version! (File->Save for previous)

Many seasoned LabVIEW users don't use the very latest LabVIEW version, so often the advice is "for LV2021 or older". I prefer LV2019…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(406 Views)

Here you go. The end goal is to have a matrix where the first value is the name and the second values is the dob.

Download All
0 Kudos
Message 3 of 10
(368 Views)

How about this. It reads all of the used range and then you can just parse out the first column.

0 Kudos
Message 4 of 10
(353 Views)
Solution
Accepted by topic author FordClark001

Here's just 1 column.

0 Kudos
Message 5 of 10
(346 Views)

Thank you!

0 Kudos
Message 6 of 10
(341 Views)

And just for completeness in this VI you give the first and last cell of the range. Just remember that the value returned is always a 2D array even if you are only reading one cell.

0 Kudos
Message 7 of 10
(327 Views)

I attempted to change the code to read the entire sheet however my solution didn't work. Theoretically how would you select all the data in the sheet?

0 Kudos
Message 8 of 10
(314 Views)

Interestingly enough when I change one of the range property nodes to entire row it doesn't provide the entire row. Why is this?

0 Kudos
Message 9 of 10
(306 Views)

I couldn't open your VI since I have LV2021 but you probably didn't change the index array from column to row. Look at this VI.

Also if you want to the whole sheet you can use the Range using First and Last Cell.vi and put in the top and bottom cell for the range. Or you can use the Read Used Range.vi which you don't have to specify any range since Excel figures that out by where your data is.

0 Kudos
Message 10 of 10
(266 Views)