From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-25-2013 12:14 PM
Why the invoke node Export Data to Excel produces empty Excel sheet with no data?
If I manually highlight the table control on the Front Panel, then run the VI again, data get exported. How does one highlight data in the table automatically?
Solved! Go to Solution.
04-25-2013 01:14 PM
murchak,
I think this is happening to you because of the LV data-flow paradigm. If your screen shot is all that is on your block diagram, then the Invoke Node actually executes first, when there isn't any data in the table. Then, the "Table Control" 2D array is populated after an empty table has been exported. When you run the VI again, the data from the first run is already populated within the table, and thus the it *appears* to working. In actuality, it was working correctly the whole time, but the first time there was just no data to export because it executed first.
You must use data flow (wires, essentially) to ensure that the data is written to the table first before the data is exported to Excel second. A flat sequence structure or error wires (preferred) can help:
Hope this helps,
04-25-2013 01:19 PM - edited 04-25-2013 01:21 PM
I thought that at first also but after testing (before I posted ) I can see the order does not matter. Only the selection is copied over. If nothing is selected the sheet will be blank.
Note: you can programmatically select cells using a property node (selection start and selection size).
So it does appear to be a bug...
04-25-2013 03:14 PM
solution:
12-02-2022 03:29 AM
I just had the same problem. How can this be a solution to set start and size when you don't know who many cells are filled with data?
The only thing you can do is to read the array size and mark the entire array for export.
12-02-2022 04:52 AM - edited 12-02-2022 04:54 AM
Hi MaSta,
@MaSta wrote:
The only thing you can do is to read the array size and mark the entire array for export.
It works for me without using any selection properties:
When the invoke node is executed then a new Excel workbook opens with the expected data…
12-02-2022 06:01 AM - edited 12-02-2022 06:03 AM
@GerdW wrote:
Hi MaSta,
@MaSta wrote:
The only thing you can do is to read the array size and mark the entire array for export.
It works for me without using any selection properties:
When the invoke node is executed then a new Excel workbook opens with the expected data…
Hi Gerd,
you are working with an array, not with a table. For an array I see your results too, for a table I see a blank Excel sheet.
I don't know if MaSta can change to an array.
12-02-2022 06:09 AM
Hi Uli,
good point, I missed that specific requirement!
I don't understand why a programmer wants to use this invoke node at all as the program(mer) has no control over the user actions done on that new Excel workbook. (It's the same with export functions available in the context menu of graphs.)
I would rather write data to a CSV file or handle Excel entirely using ActiveX/RGT functions…
12-02-2022 07:08 AM
The other method which copies the table data into cliboard does the same job, but has the same requirement, or the clipboard would be empty.
I was just experimenting. I actually hoped for the method to come up with a save dialog, means to export the data to an Excel file. Only people with Excel installed could use the method as it is.