LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange behaviour with ActiveX invoke node and Excel

I want to send a table of numbers from LV50.1f to Excel97. After getting a
reg to Excel8.Application I retrieve the Workbooks property, Invoke Item to
select a certain Workbook reference, retrieve the Worksheets collection
reference, Invoke Item and then get a reference to WORKBOOKS again.

Strangely, there is an example code from the NI web site that does exactly
the same, but in the last step a variant is returned in stead of a
reference, which is converted using Variant to G to a Worksheet reference.
when I copied that last invoke node to my VI I also had a variant returned,
so on one diagram I had to invoke nodes connected to the same sources, one
returning a ref, the other returning a variant!

Disco
nnecting the sources to my Invoke node and rewiring gave no change.
Also type casting the ref to workbooks to a worksheets ref, didn't work - I
get errors in the following property node that retrieves a Range - which
exists in Worksheet, but not in Workbooks.

Appearantly, LV gets the returned type mixed up sometimes, and there is no
way to fix it other then copying a invoke node from another diagram?

Finally I got it working though, but this behaviour puzzles me. Contrary to
the example from NI, I now managed to send a table (2d array of strings) in
one call to Excel (don;t need to loop over cells or columns).

PS
I used to do the same using DDE but ranges are different for each language
version of Excel (i.e. R1C1 for English and R1K1 for Dutch), so my VI's need
to know the language of Excel. Also with NT and Win98, getting a DDE
connection often hangs LV. But a big progress has been made - now I need
different VI's for each version of Excel!!!

--
Ferry Toth
Enraf BV, The Netherlan
ds
0 Kudos
Message 1 of 1
(2,814 Views)