I can't figure out how to use the On Error GoTo handler correctly. In the following macro, the idea is that when the browser is not found in the specified path, an error message appears. The problem is that the message pops up even when there is no error.
Code: Select all
Sub Main()
On Error goto EH
Shell("C:\Program Files\Mozilla Firefox\firefox.exe", 1, "http://www.openoffice.org")
EH:
MsgBox("Couldn't find the browser.")
End Sub
Thank you!
Kind regards,
Dmitri