06-14-2017 07:42 AM
Hi,
I already post some questions, this one is for the security of my program. Indeed, during my measurment, i save data in Excel. If someone close Excel I can't wanr people when a theshhold is reached.
My question is, is there a way to lock the Excel file during my measurment ?
Excel_Rpt or Excel ? (I found the Excel_WorkbkEventsRegOnBeforeClose but i don't know how to use it)
PS: Roberto, I count on you 😄 you helped me a lot ! (I accept help from anyone 🙂 )
Matthieu
Solved! Go to Solution.
06-14-2017 09:23 AM
Hello Matthieu,
I'm sorry but I cannot help you in this matter: I normally don't rely on Excel for long-lasting tasks, I use if to read/write measurements and test results but when I need to store and operate on test data during program life I prefer to wite a different file without relying on a separate program. The problem you are facing (somebody closes Excle while you are using it) is just one of all those I can think of.
06-14-2017 05:00 PM - edited 06-14-2017 05:00 PM
Do you really need the Excel application to be open? If not, you may just want to set the visible property of the application to false (you can do this when you call ExcelRpt_ApplicationNew). I wouldn't consider that a security feature, but it would probably prevent people from instinctively closing the app when they aren't expecting it to popup.
As for Excel_WorkbkEventsRegOnBeforeClose - you should be able to figure out how to use it from the function help (right click anywhere in the function panel or parameters). I made an example some time ago that uses Excel_AppEventsRegOnSheetBeforeDoubleClick. It should be similar:
Registering an Excel Event as a Callback in LabWindows/CVI
Like Roberto mentioned - if you're just looking to save measurement data, there are more efficient ways than the Excel ActiveX API.
Hope this helps!
Trent
06-15-2017 06:46 AM
Thank you and Roberto for answering,
I need Excel because I have to add an Antenna factor to change the unit (dBµV to dBµV/m). I search the Max and if a value is above a certain value, I warn people thanks to a song. I may use differents antennas so I have 4 Excel files for each one.
But i think I'll set the visible property. It's a good alternative.
Thank you guys !
Matthieu