I don't know about a list of ONLY errors produced when opening a workbook but
the following procedure [ErrorList] will list all error messages that VBA
Excel throws. If a number is not listed, the Description is
'Application-defined or object-defined error'.
'/==============================================/
Public Sub ErrorList()
'create list of all errors with descriptions from
' Active Cell down
Dim i As Long, iMax As Long, x As Long
Dim varAnswer As Variant
On Error GoTo err_Sub
iMax = 5000
varAnswer = _
MsgBox("The process will list errors and descriptions." _
& vbCr & vbCr & "Any errors with the description " _
& vbCr & "'Application-defined or " & _
"object-defined error' will not be included in the list." _
& vbCr & vbCr & _
"All cells below the Active cell will be erased." & _
vbCr & vbCr & "Continue?", _
vbCritical + vbYesNo + vbDefaultButton2, _
"Create Error Listing...")
If varAnswer = vbYes Then
On Error Resume Next
ActiveCell.Offset(x, 0).value = "Err.Number"
ActiveCell.Offset(x, 1).value = "Err.Description"
For i = 1 To iMax
Err.Clear
Err.Raise i
If Len(Err.Description) <> 0 And _
Err.Description <> _
"Application-defined or object-defined error" Then
x = x + 1
ActiveCell.Offset(x, 0).value = Err.Number
ActiveCell.Offset(x, 1).value = Err.Description
End If
Err.Clear
Next i
End If
On Error GoTo err_Sub
Err.Clear
Cells.EntireColumn.AutoFit
ActiveCell.Offset(1, 0).Activate
ActiveWindow.FreezePanes = False
ActiveWindow.FreezePanes = True
ActiveWindow.Zoom = 75
exit_Sub:
Exit Sub
err_Sub:
GoTo exit_Sub
End Sub
'/==============================================/
--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown