LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I select an Excel range by mouse and copy the data into labVIEW

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.

http://forums.ni.com/t5/LabVIEW/how-do-i-copy-data-from-excel-into-labview/m-p/757088/highlight/true...

 

Regards mkoppelgaard

0 Kudos
Message 1 of 6
(3,431 Views)

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.

http://forums.ni.com/t5/LabVIEW/how-do-i-copy-data-from-excel-into-labview/m-p/757088/highlight/true...

 

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

Download All
Message 2 of 6
(3,398 Views)

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

 

copy and paste.PNG 

Then just copy the section from Excel and paste it into the string control (Use Ctl+V to paste)

 

 

========================
=== Engineer Ambiguously ===
========================
Message 3 of 6
(3,388 Views)

Seems that I have to use my Christmas holydays to understand these subjects Smiley Happy

Thank you for you reply.

I look into it - but if you think is difficult might not have big changes Smiley Sad

0 Kudos
Message 4 of 6
(3,343 Views)

RTSLVU solution is simple and easy to implement if you accept to do the copy paste operations "manually" after you have selected a range in Excel.

 

Ben64

0 Kudos
Message 5 of 6
(3,330 Views)

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.

0 Kudos
Message 6 of 6
(3,324 Views)