>Did you include the debugging information when you compiled?
Ed, FWIW,
I did this test:
x= 3
y='c'
on error messagebox( message(1) )
?x=y
on error
It returns the line of code when I do the exe from the command window, but when I do it from the explorer, message(1) = "do test.exe"
Whether it's a bug or by design, I can't guess since I have no clue how the program code is stored in a debug-compiled EXE.