ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Msgbox Close Button (https://www.excelbanter.com/excel-programming/373336-msgbox-close-button.html)

jnf40

Msgbox Close Button
 
Is there a way to disable the red X on a Msgbox, or would you have to create
a custom userform to do this?

Jim Cone

Msgbox Close Button
 
The X in the top right corner of a message box is not colored red
and there would be no normal reason to remove it.

The "Critical" notice on a message box ( a red X) is created by the
inclusion of the constant "vbCritical" as one of the msgbox arguments.
You can simply remove it or replace it with vbInformation or vbExclamation.
As an example, try both code lines below:

x = MsgBox("This is a test", vbOKCancel + vbCritical, " Test of X")
'---
x = MsgBox("This is a test", vbOKCancel , " Test of X")

'--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"jnf40"
wrote in message
Is there a way to disable the red X on a Msgbox, or would you have to create
a custom userform to do this?


All times are GMT +1. The time now is 07:08 AM.

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