Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 122
Default on error in whole workbook ?

Hi,

I have so much code that i would like to know if there is an 'on error'
possible that would work throughout all the codes and subs in the application.


On error, i would like to know what the error is and then close the
application.
Any ideas?
thanks,
Pierre


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200510/1
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default on error in whole workbook ?

Sub test()
On Error GoTo error_handler
'' do your stuff


Exit Sub
error_handler:
MsgBox "An error occured in test. " & vbCr & Err.Description & vbCr &
Err.Number
Err.Clear
Application.DisplayAlerts = False
Application.Quit
End Sub


Greetz,

Rody

"Pierre via OfficeKB.com" <u13950@uwe schreef in bericht
news:567ae48b77ed6@uwe...
Hi,

I have so much code that i would like to know if there is an 'on error'
possible that would work throughout all the codes and subs in the
application.


On error, i would like to know what the error is and then close the
application.
Any ideas?
thanks,
Pierre


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200510/1



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 122
Default on error in whole workbook ?

thanks Rody !
Works fine.
Pierre


Rody Meulman wrote:
Sub test()
On Error GoTo error_handler
'' do your stuff

Exit Sub
error_handler:
MsgBox "An error occured in test. " & vbCr & Err.Description & vbCr &
Err.Number
Err.Clear
Application.DisplayAlerts = False
Application.Quit
End Sub

Greetz,

Rody

Hi,

[quoted text clipped - 7 lines]
thanks,
Pierre



--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200510/1
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
Error - No more new fonts in this workbook James A Excel Discussion (Misc queries) 5 December 12th 06 12:57 AM
Link to another workbook error Brian Excel Discussion (Misc queries) 3 December 2nd 05 06:31 PM
error when using variable name for workbook Emma Excel Programming 2 January 26th 05 09:29 PM
Error when Open WorkBook tetors_2002[_5_] Excel Programming 1 May 17th 04 06:10 PM
Workbook reference error R Avery Excel Programming 3 April 14th 04 01:57 PM


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

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

About Us

"It's about Microsoft Excel"