Log in

View Full Version : Solved: OnExit



Lindie
07-30-2008, 04:15 PM
I'd like to protect a workbook when the user exits the book. I guess this should be done using some OnExit function that calls up workbook protection automatically.
How do I make a start with this?
Lindie

Bob Phillips
07-31-2008, 12:16 AM
If you mean protect the code, just set the password normally, no need to do it on exit.

Lindie
07-31-2008, 12:23 PM
I need to protect the data entered by the users. There is a macro button on the sheet but they just don't click on it.
I should have used Workbook_BeforeClose

and that now runs the maro beautifully. I just wonder is OnExit used for anything? I cannot see this in the VBA function calls.

Bob Phillips
07-31-2008, 02:17 PM
You will have to enlighten me, what is OnExit, I have never come across it?

So what is the underlying question?

Lindie
07-31-2008, 02:33 PM
OnExit is Javascript so it would not feature in VBA. I got a bit mixed up hence it would not work for me in VBA.
L