12-31-2008 10:37 AM
I have seen people call external programs through LabVIEW and was curious what functions you could use to do this.
I'm pretty sure its using one of the ActiveX functions or maybe 'open application reference .vi'.
Can anyone tell me (or show me) a quick example of how to open an external program (ie excel, notepad, etc) programatically
Solved! Go to Solution.
12-31-2008 10:50 AM
HI Cory,
Take a look at Help >>> Find Examples >>> Communicating with External Applications >>> ActiveX >>> Excel >>> Write Table to XL.vi
To step back and answer your Q in a general fashion.
The methods required or possible to interact with external apps depends on the the external app and what mechanisms it supported.
SysExec
Used to for programs tha can be invoked from a DOS command line.
DCOM
The app had to support this and you work with it doing peeks and pokes.
ActiveX
Only available on Windows and the methods and properties all depend on the app.
.NET
Newest version of interacting with apps.
Have fun!
Ben
12-31-2008 11:00 AM - edited 12-31-2008 11:01 AM
Thanks Ben.
I was looking at the example 'Write Table to XL',
and within that, the subVI 'Open Excel'.
Where did they get this:
I dont know what constant to type in, or where to get this value.
12-31-2008 11:08 AM - edited 12-31-2008 11:13 AM
Cory K wrote:...
Where did they get this:
...
Kudos for going from "I don't know to start" to "Let's stump Ben" with only the second post to this thread.
I either copy it from an example or try to browse to it.
NOTE:
If you plan to work with MS ActiveX objects, I found it very helpful to do a custom install of Office and make sure the help files for VBA are loaded. These will at the least give you an idea of what the methods are and what parameters go with each.
Ben
12-31-2008 11:22 AM - edited 12-31-2008 11:24 AM
So If I wanted to open Windows Media Player, for example, I would do this?
01-02-2009 10:43 AM
01-02-2009 10:47 AM - edited 01-02-2009 10:48 AM
smercurio_fc wrote:
You could, but more than likely for Windows Media Player you would actually be working with the ActiveX control on the front panel. Thus, it would reside inside an ActiveX container, and the reference is opened automatically by it being in the container. In fact, there's a pre-existing ActiveX container with the Windows Media Player control embedded in the .NET & ActiveX subpalette of the Control palette.
Where is this ActiveX control?
I went to the front panel and added an ActiveX container.
Then I right-clicked, and said Insert ActiveX object,
but there is no WMP or windows media player or microsoft WMP...etc
Do you know where it is located?
Edit *** Nevermind, I just overlooked it. Thanks for your help