You can also use the ERL function to return the line number where an error occurred. It's an undocumented function but has come in handy for me. The catch is you have to number all the lines in your code. Fortunately, that process has been simplified with a VB Add-In that will number all the lines in your project for you. Here is the URL for the article in a back issue of MIND magazine that details everything. The VB Add-In is included with the source code download for the article: