ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MsgBox instead of compile error (https://www.excelbanter.com/excel-programming/440508-msgbox-instead-compile-error.html)

KP[_4_]

MsgBox instead of compile error
 
Hi,

When running a macro I sometimes get an error due to the fact that the
Webpage from which I receive some updates to the macro is down.

Is it possible in stead of the well-known 'comile-error' that I can have my
own message box to pop up. At least before the compile error message?
How should such a macro be created. I presume it should be in the beginning
of the macro.

Thanks for any suggestions.


Kaj Pedersen



Bob Phillips[_4_]

MsgBox instead of compile error
 
Try

OnError Goto errhandler

'your code

Exit Sub

errhandler:
Msgbox "Error"


--

HTH

Bob

"KP" <none wrote in message
...
Hi,

When running a macro I sometimes get an error due to the fact that the
Webpage from which I receive some updates to the macro is down.

Is it possible in stead of the well-known 'comile-error' that I can have
my own message box to pop up. At least before the compile error message?
How should such a macro be created. I presume it should be in the
beginning of the macro.

Thanks for any suggestions.


Kaj Pedersen




KP[_4_]

MsgBox instead of compile error
 
Thanks you very much, it works.
I figured out that in my version of Excel I had to use the word
"ErrorHandler" .
Otherwise it wouldn't work.

Kaj Pedersen



"Bob Phillips" skrev i en meddelelse
...
Try

OnError Goto errhandler

'your code

Exit Sub

errhandler:
Msgbox "Error"


--

HTH

Bob

"KP" <none wrote in message
...
Hi,

When running a macro I sometimes get an error due to the fact that the
Webpage from which I receive some updates to the macro is down.

Is it possible in stead of the well-known 'comile-error' that I can have
my own message box to pop up. At least before the compile error message?
How should such a macro be created. I presume it should be in the
beginning of the macro.

Thanks for any suggestions.


Kaj Pedersen






Bob Phillips[_4_]

MsgBox instead of compile error
 
Really, I am surprised, that is just a label.

--

HTH

Bob

"KP" <none wrote in message
...
Thanks you very much, it works.
I figured out that in my version of Excel I had to use the word
"ErrorHandler" .
Otherwise it wouldn't work.

Kaj Pedersen



"Bob Phillips" skrev i en meddelelse
...
Try

OnError Goto errhandler

'your code

Exit Sub

errhandler:
Msgbox "Error"


--

HTH

Bob

"KP" <none wrote in message
...
Hi,

When running a macro I sometimes get an error due to the fact that the
Webpage from which I receive some updates to the macro is down.

Is it possible in stead of the well-known 'comile-error' that I can have
my own message box to pop up. At least before the compile error message?
How should such a macro be created. I presume it should be in the
beginning of the macro.

Thanks for any suggestions.


Kaj Pedersen








KP[_4_]

MsgBox instead of compile error
 
Hi Bob,

I am sorry . Now I see this was a misinformation. I don't know what happened
.. Now I can name it what ever I like.
Thanks again.

Kaj Pedersen



"Bob Phillips" skrev i en meddelelse
...
Really, I am surprised, that is just a label.

--

HTH

Bob

"KP" <none wrote in message
...
Thanks you very much, it works.
I figured out that in my version of Excel I had to use the word
"ErrorHandler" .
Otherwise it wouldn't work.

Kaj Pedersen



"Bob Phillips" skrev i en meddelelse
...
Try

OnError Goto errhandler

'your code

Exit Sub

errhandler:
Msgbox "Error"


--

HTH

Bob

"KP" <none wrote in message
...
Hi,

When running a macro I sometimes get an error due to the fact that the
Webpage from which I receive some updates to the macro is down.

Is it possible in stead of the well-known 'comile-error' that I can
have my own message box to pop up. At least before the compile error
message?
How should such a macro be created. I presume it should be in the
beginning of the macro.

Thanks for any suggestions.


Kaj Pedersen











All times are GMT +1. The time now is 09:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com