Alby Posted March 8, 2007 Report Share Posted March 8, 2007 Hi anyone, I need to prevent a user to close an Excel session by clicking on the X symbol in the right top or in other ways from inside Excel. The reason to do this is because the Excel session is opened by LabVIEW and I need to close it by LabVIEW; on the contrary (clicking on the X symbol of Excel) it's impossible to open an Excel session from LabVIEW again (the refnum is not cancelled by the same application). I think the better thing is to hide the Excel title bar in some ways but I can't find out the right way. Is there someone who can help me? Thank you Quote Link to comment
Ton Plomp Posted March 8, 2007 Report Share Posted March 8, 2007 Their are several options I can think off, all are difficult. For one it is possible to have an activex container with an excel worksheet. Or more advanced, create a callback VI for the 'application close event', and then display a message to the user. Ton Quote Link to comment
Yair Posted March 8, 2007 Report Share Posted March 8, 2007 I don't know if you can manipulate the Excel window like that from another program (you should check out the MSDN for the window functions. You should also check out the winutil32 library from the NI site), but have you considered embedding the spreadsheet in your front panel using an ActiveX container? Quote Link to comment
Alby Posted March 9, 2007 Author Report Share Posted March 9, 2007 Tank you, I think It's a good idea to include an Excel sheet into a VI using an activeX container but I didn't find out the way to do that and any kind of example. Can you help me? Tank you. Quote Link to comment
Yair Posted March 9, 2007 Report Share Posted March 9, 2007 I don't have any experience with it. Simply embed an Excel object in an ActiveX container (it should be called "Microsoft Office Spreadsheet" or something similar) and look at the properties and methods it has. I know that the Office class hierarchy can be confusing, but it should be documented in the help for Office. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.