Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
run-time error Dialog Albert Excel Programming 0 February 9th 09 04:34 PM
Error dialog box meaning and how to find error Jeanne Excel Worksheet Functions 2 September 4th 08 04:59 AM
Error dialog Gert-Jan[_2_] Excel Programming 3 October 9th 06 03:39 AM
How to avoid an error dialog justaguyfromky Excel Programming 2 February 18th 06 10:02 PM
Common Dialog Error Clement Excel Programming 1 November 19th 03 12:10 PM


All times are GMT +1. The time now is 02:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"