If you do not already use it, I would recommend getting hold of MZ Tools addin for VBA (it is free, but you can donate to the author if you find it useful) which will allow you to add line numbers to your code. You can then use a central error logging routine called from each routine, passing a module name and line number (using Erl).