09-12-2014 01:41 PM
Good afternoon,
I am creating a test program that detects if Excel is open. I used the TaskList command line of the System Exec.vi to give me a list of processes that are currently running, then doing a search on excel.exe using the Search and Replce feature I am using the offset past replacement indicator wired to a greater than 0 primitive to determine if Excel is indeed running.
If the primitive returns false, I can open the file using the New Report.vi with the templete contntrol wired in. If it returns true, I'd like it to see if the Workbook is loaded and if not, load it. But I can't seem to get the NI Report labview class wire right, most likely because I do not know how ti generate it.. Does anyone know how to generate this wire or am I just overthinking things here? My VI is attached.
Solved! Go to Solution.
09-12-2014 01:57 PM
No LabVIEW 2014 for me.
09-12-2014 02:11 PM
Try this one in 2012.
09-12-2014 02:27 PM - edited 09-12-2014 02:28 PM
I am not sure that you will be able to do what you want to do.
http://www.ni.com/white-paper/3179/en/
You might want to consider just closing Excel if is opened.
One way is to use LabVIEW's .NET pallete to detect whether Excel is running.
Then close that process.
09-12-2014 03:14 PM
Damn. That sucks. Thanks for helping.
09-12-2014 04:30 PM
Why do you need to close Excel? If your template is already open, the New Report VI will grab the open reference and use it (if the file has previously been saved).
09-12-2014 04:37 PM
Create a blank workbook and save it somewhere. Modify the path constant to match the file location and run the VI (with the workbook opened or closed).
09-13-2014 08:48 AM - edited 09-13-2014 09:04 AM
Ah. I assumed that using the New Report.vi would create another reference to Excel and two references would then be open. I'll give it a try.