LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Drag and drop text from WORD or EXCEL into text control of running VI

Trying to drag and drop text from WORD and EXCEL into a running VI.  When drop text on text control, only able to get MOUSE ENTER event when drop the text.  Do not see any DRAG events.  Only able to get DRAG events when dragging text from another text control on same VI.  Any ideas??

Thanks,
Dan

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

Dan,

LabVIEW does not support dragging/dropping between 3rd party applications, in the same way that you can not drag/drop data from LabVIEW into Excel/Word -- there is simply no way for either program to know what data is coming or to exchange events. Within LabVIEW, dragging/dropping is supported between controls/indicators and even between VIs, and you should be able to get the proper dragging events doing this. To communicate or exchange data with Excel or Word in LabVIEW, you will need to use File I/O or ActiveX, which is a common API that all Windows programs use to communicate with each other.

Kind Regards,

E. Sulzer
Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(3,505 Views)
Where might I find an example VI using an activeX control for this purpose?

Thanks.
0 Kudos
Message 3 of 6
(3,487 Views)

Hello,

AESulzer was referring to using the ActiveX client/server model to transfer data between LabVIEW, and Excel for example.  To see an example where Excel is an ActiveX client to LabVIEW as an ActiveX Server, open the following excel document which should be on your machine if LabVIEW is installed (it links to a macro which will run a VI, extract data from it, and plot it in excel):

C:\Program Files\National Instruments\LabVIEW 8.0\examples\comm\freqresp.xls

(or the corresponding folder for your version of LabVIEW)

Note that you may have to change the Macro security settings to medium or low in Excel (see Tools -> Macro -> Security) and restart Excel before Excel allows you to execute it. Also note that you don't even have to have LabVIEW open when you run the macro in Excel (which can be done by clicking Ctrl + L - there are instructions in the excel document) as it will open the development environment and then open and run the VI if LabVIEW is not already open. Finally, if you want to view the code for an example of the kind of syntax you'll use to access LabVIEW this way, you can view the contents of the macro which "loads the data" called "Load Data" by clicking in Excel: Tools -> Macro -> Macros... and then selecting the Load Data macro and clicking the "Edit" button. As a side note, the shortcut for "Tools -> Macro -> Macros..." is usually Alt + F8.

For LabVIEW as a client and Excel as a server, click Help -> Find Examples... in LabVIEW and search the keyword activeX to find the example named "Excel Macro Example.vi"

I hope this helps!

Best Regards,

JLS

Message Edited by JLS on 04-03-2006 11:49 AM

Message Edited by JLS on 04-03-2006 11:50 AM

Best,
JLS
Sixclear
0 Kudos
Message 4 of 6
(3,457 Views)
Thank you for your help.

Dan


0 Kudos
Message 5 of 6
(3,445 Views)
No problem,
 
I hope it gives you the tools you need to implement your desired functionality!
 
Best Regards,
 
JLS
Best,
JLS
Sixclear
0 Kudos
Message 6 of 6
(3,431 Views)