LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve Text From Spreadsheet

Hello Everyone!

I'm trying to use the attached code to retrieve the "Operator's Initials" from an Excel spreadsheet. I keep getting a zero when I should be getting some letters. I think there is a data type conflict. What's up with that? Can you help?

Drew

0 Kudos
Message 1 of 6
(3,013 Views)
Drew,

The subVI is not included (Use Save As...>>Development Distribution to create a .llb file).

The most likely problem is that the format string is set to "%d". Try "$s" for string output.

Lynn
0 Kudos
Message 2 of 6
(3,007 Views)
Here's the LLB file then.
0 Kudos
Message 3 of 6
(3,006 Views)

You mention that you are reading this from an excel spreadsheet, if this is the case you will need either the office toolkit, or you will need to use active x to open and extract information from a specific cell.

Alex Hawman

Prototype process development specialist, ZF Sachs Automotive.

 

 

0 Kudos
Message 4 of 6
(2,996 Views)
Not only do you have the wrong format string (%d instead of %s), your Read_Strings_From_Spreadsheet doesn't read strings. You haven't done the modifications necessary for it to return strings instead of numbers. Re-read the instructions on the diagram. And, as Alex says, if you're attempting to read a native xls file, it won't work at all. If you save the xls file as a tab or comma separated text file, then you can make the changes I mentioned and try it again.
0 Kudos
Message 5 of 6
(2,989 Views)
When I convert the subVI to return string arrays instead of numeric arrays it works.

Lynn
0 Kudos
Message 6 of 6
(2,987 Views)