Hi it's me again.
<pre>
Sub test2()
On Error GoTo WriteLog
Cells(0, 1).Select 'Error
MsgBox "Code is still running."
Exit Sub
WriteLog:
' // Please write fullpath where you want to set instead of ErrorLog.txt
' // EG. C:myfolderErrorLog.txt
Open "ErrorLog.txt" For Append As #1
Print #1, Now & " " & Err.Number & ":" & Err.Description
Close #1
Resume Next
End Sub
</pre>