maxmangion
AWF VIP
- Local time
- Today, 01:56
- Joined
- Feb 26, 2003
- Messages
- 2,805
when creating an error handling routine, if i would like to record the error message to a textfile, apart from just displaying a msgbox, is the following method correct or there is a better approach ?
Code:
Exit_Err_Handler:
Exit Sub
Err_Handler:
MsgBox Err.Description, vbExclamation + vbOKOnly, "Error #" & Err.Number
Open "C:\Documents And Settings\user\Desktop\Error.log" For Output As #1
Print #1, Err.Description & Err.Number
Close #1
Resume Exit_Err_Handler