12-22-2014 03:46 AM
I would like to import data from Excel to LabVIEW by marking an range with the mouse
There is a lot of examples using excel but I can’t find any that covers my topic.
This I want to do from LabVIEW:
Its 1-dim.
I’m absolutely new in LabVIEW and would be grateful for any help.
I found this example but that’s not exactly what I want.
Regards mkoppelgaard
12-22-2014 09:20 AM
Michael.Koppelgaard a écrit :
I would like to import data from Excel to LabVIEW by marking an range with the mouse
There is a lot of examples using excel but I can’t find any that covers my topic.This I want to do from LabVIEW:
- Browse for an excel file
- Mark an area in the file by mouse
- Copy the data from the marked area to an array in LabView
Its 1-dim.
I’m absolutely new in LabVIEW and would be grateful for any help.
I found this example but that’s not exactly what I want.
Regards mkoppelgaard
This is not an easy task for someone new to LabVIEW. You need to understand LabVIEW, ActiveX and ActiveX Event Callback because you need to use Excel SelectionChange event.
Attached is a vi that do this: Get Excel Range Values.vi, to use it you also need the callback vi (also attached) SelectionChangeEventCallback.vi. Maybe it's not exactly what you want (the output is 2D array, I reused smercurio_fc vi from the link you posted) but you can probably easily modify it.
Ben64
12-22-2014 09:39 AM - edited 12-22-2014 09:42 AM
If you want to manually copy an area from an Excel spreadsheet and paste it into a Labview program then that is easy
Just use a string conrol and Spreadsheet string to array
Then just copy the section from Excel and paste it into the string control (Use Ctl+V to paste)
12-22-2014 04:27 PM
Seems that I have to use my Christmas holydays to understand these subjects
Thank you for you reply.
I look into it - but if you think is difficult might not have big changes
12-22-2014 04:45 PM
12-22-2014 05:06 PM
Yes it is easy - that’s for correct. A very good solution.
That might also be my solution.
But first I want to try out another solution - an idea I just got.
What about writing an excel macro which ask you to open an file and select the area.
The macro writes to content of the area to a file.
You let LabVIEW read the content of the file and write it to an array.
In the example finder, I found code for starting an excel macro.
And I have written many macros so that should be easy.