ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   "End" Button for Error Messages (https://www.excelbanter.com/excel-programming/404993-end-button-error-messages.html)

Steph

"End" Button for Error Messages
 
Is there a way in VBA to display a message box that shows the just the
following:

-- Error Code
-- Error Message
-- An "End" button

I want to use an "End" button to force an immediate stop to the application.
I've experimented with the "OK" button and error trapping but, due to the
way my application is built, the code seems to continue to loop even after an
error is trapped.

Thank you for your help.

--
Steph

papou[_4_]

"End" Button for Error Messages
 
Hello Steph

There is no such End button in common Excel message boxes. You could use a
userform though.
But since your are having trouble in ending the sub when an error occurs,
envisage using the End instruction, eg:
On Error Goto ErrTrap
'......
Exit Sub

ErrTrap:
Msgbox "Error number " & Err.Number & " " & Err.Description
End
End Sub

HTH
Cordially
Pascal

"Steph" a écrit dans le message de news:
...
Is there a way in VBA to display a message box that shows the just the
following:

-- Error Code
-- Error Message
-- An "End" button

I want to use an "End" button to force an immediate stop to the
application.
I've experimented with the "OK" button and error trapping but, due to the
way my application is built, the code seems to continue to loop even after
an
error is trapped.

Thank you for your help.

--
Steph





All times are GMT +1. The time now is 05:33 PM.

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