LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

EXCEL unicode export LabVIEW

Dear members
 
I like to export unicode strings from EXCEL to LabVIEW using ActiveX.
The ActiveX programming isn't the problem the problem ist the transfer.
I tried to use a variant and cast it into a LabVIEW string but it doesn't seam to
work for me.
Any suggestions a welcome.
 
With kind regards

Martin Kunze

KDI Digital Instrumentation.com
e-mail: martin.kunze@digital-instrumentation.com
Tel: +49 (0)441 9490852
0 Kudos
Message 1 of 3
(3,440 Views)
http://forums.ni.com/ni/board/message?board.id=170&message.id=173261&query.id=146890#M173261

This thread explains LV and unicode.
Regards,
André (CLA, CLED)
0 Kudos
Message 2 of 3
(3,430 Views)

I realise this thread is 16 years old but I had the same problem and eventually found a solution.

 

I noticed that if I did 'variant to flattened string' on the entire variant, I was getting the Unicode hex values, but the most significant byte was being lost on conversion to any sort of string array (even Unicode string array).

 

So I used 'variant to data' to convert to a 2d array of variant, then did variant to flattened string on each element, converted that to UTF16-LE, removed a few bytes and then it displays as Unicode correctly. This is with "UseUnicode=TRUE" in the LabVIEW.ini file.

 

Perhaps there is a neater way, but I haven't found it yet.

 

I have attached an example with an Excel file to test it in. Hope this helps someone!

 

Leah

0 Kudos
Message 3 of 3
(670 Views)