Another potential "gotcha" with Try ... Catch blocks can be illustrated by a modified version of our Divide by Zero example. Suppose you decided to change the program so the values of X, Y, and Z that caused the error would be displayed using the Debug.WriteLine statement. You might try coding it this way:
~~~~~~~~~~~~~~~~~~~~~~~~~
Try
' The traditional Divide By Zero error
Dim X, Y, Z As Integer
X = 1 : Y = 0
Z = X / Y
Catch ex As Exception
Debug.WriteLine("exception using X, Y, and Z values" _
& vbCrLf & vbTab & X & Y & Z)
End Try
~~~~~~~~~~~~~~~~~~~~~~~~~

