LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Report In Excel class

Solved!
Go to solution

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.

0 Kudos
Message 1 of 8
(3,881 Views)

No LabVIEW 2014 for me.

0 Kudos
Message 2 of 8
(3,877 Views)

Try this one in 2012.

0 Kudos
Message 3 of 8
(3,867 Views)

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.

http://msdn.microsoft.com/en-us/library/1f3ys1f9%28v=vs.110%29.aspx?cs-save-lang=1&cs-lang=vb#code-s...

Then close that process.

 

GetProcesses.png

0 Kudos
Message 4 of 8
(3,861 Views)

Damn. That sucks. Thanks for helping.

0 Kudos
Message 5 of 8
(3,845 Views)
Solution
Accepted by topic author Eric1977

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). 

aputman
0 Kudos
Message 6 of 8
(3,837 Views)
Solution
Accepted by topic author Eric1977

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).

 

Example_VI_BD.png

aputman
0 Kudos
Message 7 of 8
(3,834 Views)

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.

0 Kudos
Message 8 of 8
(3,806 Views)