ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   auto protect or run VBA? (https://www.excelbanter.com/excel-programming/276927-auto-protect-run-vba.html)

Michel[_3_]

auto protect or run VBA?
 
How can I be shure no-one can change any data before my login/pass
routine has been succesfully run. I mean the could disable the macro's
before starting the workbook or they can even press ctrl-break to stop
the running user/pass VBA!!!

Harald Staff[_4_]

auto protect or run VBA?
 
You can never be sure, Excel is not built for high security. The best thing you can do as
far as I know, is to make the workbook completely useless if your code isn't completely
finished. Usually that is done by unhiding or unlocking, and re-hiding/locking before the
file is closed. If code is disabled or interupted then you have a workbook with everything
locked/hidden.

--
HTH. Best wishes Harald
Excel MVP

Followup to newsgroup only please.

"Michel" wrote in message
om...
How can I be shure no-one can change any data before my login/pass
routine has been succesfully run. I mean the could disable the macro's
before starting the workbook or they can even press ctrl-break to stop
the running user/pass VBA!!!




Michel[_3_]

auto protect or run VBA?
 
Well, if I would hide and lock the sheets until the code is running
than they could save the workbook before the code can hide and lock it
again, not?
Or is there a way to auto start VBA before it get's saved?




"Henry" wrote in message ...
Micheal,

To stop the user from using Ctrl+Break, put this as your first line of code
in your Auto-Open sub:
Application.EnableCancelKey = xlDisabled

Remember to enable it again before you exit XL with
Application.EnableCancelKey = xlEnabled

As to stopping your users form disabling macros at start up, see Harald's
comments above.


HTH
Henry
^^You think you've made it idiot-proof, then along comes a bigger and better
idiot!^^

"Michel" wrote in message
om...
How can I be shure no-one can change any data before my login/pass
routine has been succesfully run. I mean the could disable the macro's
before starting the workbook or they can even press ctrl-break to stop
the running user/pass VBA!!!



All times are GMT +1. The time now is 12:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com