Is it possible to view in run time the program line which result error. Something like this:

Code:
Private Sub Command1_Click()
On Error GoTo err_handler
 
 Open "c:\data\some_text.txt" For Input As #1
 'that file doesn't exists, so program jump to err_handler

err_handler:
 If Err.Number = 76 Then
    MsgBox "Error: " & Err.Number & " " & Err.Description
 End If
  
End Sub
This code generates error. I want to see

Open "c:\data\some_text.txt" For Input As #1

in my msgbox or write it in log file.

Or is there some other way?

Why I need this? I wrote program for another company which distribute it to their customers. But unfortunately they are not computers programmers like me (even ordinary computers users knows more than employees in this company) and I have hard time to understand them if there is an error in program.

Program is quite complex and many conditions must be meet for program to work properly (user must prepare those conditions) so I don’t wanna discus about error handling!

I just wanna the last line of code in log file (code that generates error).

Thnx for your help!

Ermin