LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW invoke node problem: Excel QueryTables contains unwired or bad terminal

I'm attempting to use Excel via ActiveX but have hit a snag. What I want to do is use the QueryTables.Add method to copy data from a CSV file to an existing worksheet, but the documentation for the LabVIEW side of things is non-existent and the MSDN side of things does not parallel the fields of the invoke node. Adding a property node to the output-and-un-varianted result only shows read-only properties. I've tried arbitrarily wiring and un-wiring the optional nodes to no avail, and the interwebs isn't turning up any results.

 

Here is a post with the VBA equivalent code, showing the complexity of the parameters for QueryTables.Add: http://stackoverflow.com/questions/17602086/vba-copy-data-from-an-unopened-csv-file-to-worksheet-wit...

 

So my question is, does anyone know how to make LabVIEW cooperate with this method? Barring that, does anyone have a suggestion for copying data from an existing plain text file to an existing workbook as a new sheet?

 

Thanks in advance!

 

Oh, some version info may be useful too:

LabVIEW 2011 SP1

Microsoft Excel 14.0 Object Library Version 1.7

0 Kudos
Message 1 of 3
(2,668 Views)

Talking to excel with activex is (and always has been) kind of hinky... Apparently in Redmond Wa the national pastime isn't baseball, but rather rewriting the excel activex interface -- in incompatable ways, of course.

 

I can't advise you on your specific problem directly, but I can offer a couple potential workarounds. First, you can insert the data into the cells one cell at a time -- the excell example that ships with LV shows how to do this. Second, depending on what the worksheet looks like you can use the ADO database drivers to write to excel.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 3
(2,659 Views)

My current thought is to just copy the range of data into a new sheet, but I'm not holding my breath on that one either.

 

Thanks!

0 Kudos
Message 3 of 3
(2,657 Views)