ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   code execution has been interrupted (https://www.excelbanter.com/excel-discussion-misc-queries/13848-code-execution-has-been-interrupted.html)

François

code execution has been interrupted
 
Hello,

Is there a way to avoid the user to stop the process of a macro.
The reason for this is very simple : in the macro the sheet is deprotected
at the beginning and reprotect at the end. Therefore to avoid the user to
find a unprotected sheet whenever he stops the macros, I would like to set
the unbreakable switch to on.

Many thanks for your valuable help.

François

Dave Peterson

Take a look at:

application.EnableCancelKey

in VBA's help.

Read the warning in there about a "runaway" loop.

François wrote:

Hello,

Is there a way to avoid the user to stop the process of a macro.
The reason for this is very simple : in the macro the sheet is deprotected
at the beginning and reprotect at the end. Therefore to avoid the user to
find a unprotected sheet whenever he stops the macros, I would like to set
the unbreakable switch to on.

Many thanks for your valuable help.

François


--

Dave Peterson


All times are GMT +1. The time now is 07:21 PM.

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