ERR() Function Returns a Long

In Microsoft Excel 95 there were no error codes that could not be coerced into integers. This is not the case with Microsoft Excel 97. While the following code worked in Microsoft Excel 95, it may return an error in Microsoft Excel 97:

Function DemoErr()
    Dim iError As Integer
    On Error GoTo ErrorHandler
    ThisWorkbook.Worksheets("Q1PineManor").Range("Lynn") = 28 / 0
    Exit Function
ErrorHandler:
    iError = Err
    MsgBox "Error Number:" & iError
End Function

To restate, you should not rely on the particular error code that Microsoft Excel returns. You may run into an unexpected data type, as in the above case, and even if the data type is correct you may not get the value that you expect.