LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -2147352571. Type Mismatch with Variant to Data from Excel

Hello, I'm trying to use a VI to read data from an Excel spreadsheet into a 2D array of strings in LabView using ActiveX.

 

The values get passed correctly until it gets to the "Variant to Data" function where it returns the error -2147352571 Type Mismatch.

 

Any suggestions? I know it's easier to just read data in from a .csv or tab-delimited file, but the group I'm working with specifically wants support for Excel worksheets.

21922i7921D208C7140E5F

 

0 Kudos
Message 1 of 4
(4,806 Views)

Did you try and read it out as a single string? You will have to post process the data after you get it from Excel. We use the read from spreadsheet XML. This gives all of the data at one time. Then you have to post process the XML to get everything where you want it.

 

21924iDDEAA6BC98BE968A

Tim
GHSP
0 Kudos
Message 2 of 4
(4,801 Views)

Hello Jguthrie,

did you get your case done? I met similar case, however ,most of time I am able to read the data from excel, just some sheet with speiacl format i am not able to read them, there is a "-2147352571 Type Mismatch" error , not sure why, studying while waiting for the someone's answer.

0 Kudos
Message 3 of 4
(4,551 Views)

I realise that my reply might be a bit late but I think your error might be as a result of trying to read cells that contain excel errors such as #value. Certainly I have found that trying to read tabs that contain these messages almost certainly result in errors when converting the variant to a string array.

 

Hope this helps!

 

Al

0 Kudos
Message 4 of 4
(4,509 Views)