LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

test if Excel is running

Can someone give me a hint how to test with ActiveX automation if Excel is
running? For example after some VI opens Excel application and leave it
invisible.

Thanks
Ladislav
0 Kudos
Message 1 of 4
(2,912 Views)
I am not sure, but I suspect you want LabVIEW to open a new instance of Excel if Excel is already running in the background. To my knowlege, it is not possible to open a new instance of Excel although it is very easy to open new books in the already opened Excel. Many of our example Excel code will do just that. If you want to exit out of Excel, use an invoke node entitled "Quit". If you want Excel to be invisible, use the property node entitled "Visible" and set it false. Wire both of the nodes to the application reference created for Excel.

Jeremy Braden
National Instruments
0 Kudos
Message 2 of 4
(2,912 Views)
Jeremy
I would try opening Excel via ActiveX using
open new instance = True
on the Automation Open .vi
Shouldn't that do the trick ?

Martin Plassen
SINTEF

"Jeremy Braden" wrote in message
news:506500000005000000A3710000-1019262487000@exchange.ni.com...
> I am not sure, but I suspect you want LabVIEW to open a new instance
> of Excel if Excel is already running in the background. To my
> knowlege, it is not possible to open a new instance of Excel although
> it is very easy to open new books in the already opened Excel. Many
> of our example Excel code will do just that. If you want to exit out
> of Excel, use an invoke node entitled "Quit". If you want Excel to be
> invisible, use the property node entitled "Visible" and set it false.
> Wire
both of the nodes to the application reference created for Excel.
>
> Jeremy Braden
> National Instruments
0 Kudos
Message 4 of 4
(2,911 Views)
You might want to try the LabVIEW Windows Utilities. You can download them from the NI site (LVWUTIL32.ZIP I think, I know LVWUTIL.ZIP is the 16 bit version). Included in this is a library (winevent.llb) that has a VI called Get Windows Task List.vi. This VI returns an array of running tasks. Just search the array for Excel to see if it is running.

I hope this helps.

Rob
0 Kudos
Message 3 of 4
(2,911 Views)