01-22-2019 11:43 AM
Hi everybody. I'm pretty new in using LabVIEW, but I'm having lot of fun until now.
Just one simple question.. I'm acquiring data from an instrument and then when the user push the classic "Save&Exit" button it generates an excel file. Straightforward.
My code is running well, but the only things that I don't understand is that it opens microsoft excel in the background together with the dialog asking for name and folder to save it.
I was wondering if it is possible not to let Excel open and stay in background.
Attached the relevant part of the code.
Thank you for your support.
Solved! Go to Solution.
01-22-2019 12:03 PM
I am relying off of memory here but if you change your Ring Enum from "normal" to "no change", you should get the behavior desired.
One other thing to note, always upload your VI and not pictures. It gives us things to look that can affect what you're seeing or we could suggest alternatives that may be faster/easier to implement.
01-22-2019 12:05 PM
Hi Zazza,
To make it so that Excel does not pop up, you can change the state from "normal" to "minimized" or "no change", whichever you like better.
If you use "Save report to file" before "dispose report", then it will not ask you if you want to save it. "Dispose report" has an input on the bottom to close the report, which defaults to true, but since you have not saved the file yet you are getting a dialog as it tries to close Excel.
01-22-2019 12:24 PM
Here find attached the full VI. Please bear in mind that is written by a two-week LabVIEW user..
I tried to implement both answer you gave me but I run into an error on the save to file VI.
Apologize for the stupid question.
Thank you for your help.
01-22-2019 12:34 PM
Hi Zazza, what error are you receiving?
01-22-2019 12:40 PM
We all started somewhere. No question is a stupid question.
01-23-2019 02:29 AM
Here is the screenshot of the error I got.
I got rid of the error only if I remove the Save Report to File VI and if in the Dispose report I put a "true" value in the "Save changes" node. The only thing is that LabVIEW doesn't pop-up the windows where it asks to enter filename and directory, but it is hide behind the front panel and block diagram windows.
My intention would be the following: once the user press "save as" and then click "save" on the two button dialog, the VI automatically pop-up the windows explorer to let user decide filename and directory to save the Excel file.
Thank you again for your help.
01-23-2019 11:07 AM
There's a pretty good Example on using the RGT to Generate an Excel Report that can be found here in the Forum -- do a search for "Revised Generate " and see what pops up when you type those two words in the Forum's Search bar. I know the author ...
Some comments on your code, designed to give you some pointers on writing better LabVIEW code:
Bob Schor
01-23-2019 11:38 AM
Hi Zazza, it seems like a pretty generic error, maybe you are feeding the "save" VI an invalid path? Can you post your code for 2016 or a snippet of it?
01-23-2019 11:45 AM
@Bob_Schor wrote:
- The RGT uses Excel, so Excel has to be running. You don't, however, have to see it -- just start it Minimized (not "no change").
Hi Bob,
I'm using Win10, Excel 2013, and LV 2016. I like "no change" because it doesn't even appear to the user that Excel is being opened. But I can open up the Excel file afterward and verify that some text was written. If I use "minimized" and Excel is not open yet, I get an error. I use "minimized" and Excel is open, it minimizes my current workbook, does it's work, then open my workbook again, which is kind of annoying. I think it works differently on different systems though.