在这个过程中加入以下代码
private sub 过程
on error resume next '忽略所有错误
' '这些都是你的代码
' '这些都是你的代码
' '这些都是你的代码
' '这些都是你的代码
'然后在最后加上
if err<>0 then '如果有错误的话,就把错误写到C:\error.log里
open "c:\error.log" for append as #1
print #1,Error
close #1
end if
end sub