![]() |
run-time error Dialog
Hello!
Is there a way to disable the "Debug" option on the Excel Built in Run-time error Dialog without password-protecting the project? The reason for this is that I have a workbook that sometimes needs to import modules, so I can't have the VB Project password protected. However, the procedures could fail occasionaly, and I want to know about it when it happens, but I don't want the users accidentally hitting the "Debug" button which leads them to the VBE. Any other sugestions to keep users from entering the VBE without having to password protect the workbook? Thanks in advance, Albert C |
run-time error Dialog
Hi Albert,
The simplest way would be to create your own error traps. You can have traps in each sub/function, or just one in the main function call to trap all. Something like: Public Sub Main() On Error Goto MyErrorTrap line 1 line 2 .... .... line last Exit Sub MyErrorTrap: Call MsgBox("An error occurred, the procedure will now end." & _ VBCrLf & Err.Number & VBCrLf & Err.Description, _ vbOKOnly + vbCritical, "ERROR!") End Sub If this sub calls another sub where an error occurs then this trap should still be called. Hope this helps, Sean. -- (please remember to click yes if replies you receive are helpful to you) "Albert" wrote: Hello! Is there a way to disable the "Debug" option on the Excel Built in Run-time error Dialog without password-protecting the project? The reason for this is that I have a workbook that sometimes needs to import modules, so I can't have the VB Project password protected. However, the procedures could fail occasionaly, and I want to know about it when it happens, but I don't want the users accidentally hitting the "Debug" button which leads them to the VBE. Any other sugestions to keep users from entering the VBE without having to password protect the workbook? Thanks in advance, Albert C |
All times are GMT +1. The time now is 05:47 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com