ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Showing MsgBox after Control Toolbar macro runs (https://www.excelbanter.com/excel-programming/369338-showing-msgbox-after-control-toolbar-macro-runs.html)

Don Wiss

Showing MsgBox after Control Toolbar macro runs
 
I have a combo box from the Control Toolbar on a sheet. It calls a Change
macro that is behind the sheet. After the macro runs (and does a lot of
writing to various sheets) I'd like to display a warning message under
certain circumstances. The MsgBox beeps, but does not display. If I put a
stop before it and step through the code, then it displays. Also if I put a
dummy MsgBox "" first, then the second one that I want does display. But
I'd rather not do this kludge.

Don <www.donwiss.com (e-mail link at home page bottom).

NickHK

Showing MsgBox after Control Toolbar macro runs
 
Don,
Post the relevant code, otherwise it's a tad difficult.

NickHK

"Don Wiss" wrote in message
...
I have a combo box from the Control Toolbar on a sheet. It calls a Change
macro that is behind the sheet. After the macro runs (and does a lot of
writing to various sheets) I'd like to display a warning message under
certain circumstances. The MsgBox beeps, but does not display. If I put a
stop before it and step through the code, then it displays. Also if I put

a
dummy MsgBox "" first, then the second one that I want does display. But
I'd rather not do this kludge.

Don <www.donwiss.com (e-mail link at home page bottom).




Don Wiss

Showing MsgBox after Control Toolbar macro runs
 
On Fri, 4 Aug 2006 12:28:55 +0800, "NickHK" wrote:

Don Wiss wrote:
I have a combo box from the Control Toolbar on a sheet. It calls a Change
macro that is behind the sheet. After the macro runs (and does a lot of
writing to various sheets) I'd like to display a warning message under
certain circumstances. The MsgBox beeps, but does not display. If I put a
stop before it and step through the code, then it displays. Also if I put a
dummy MsgBox "" first, then the second one that I want does display. But
I'd rather not do this kludge.


Post the relevant code, otherwise it's a tad difficult.


Private Sub ComboBox1_Change()
BulkLimChange "AL"
End Sub

Sub BulkLimChange(LOB As String)
' this is called by the bulklim combo box change event
Dim S As String
If ActiveSheet.Name = "GU_Pick_" & LOB Then
AllCalcs LOB ' this macro calls lots of code, including numerous calls to an Access database
If Application.EnableEvents Then
S = Range("LRLossCostRate").Formula
If Left(S, 1) < "=" And Len(S) < 0 Then
' this first one is not displayed, but if not here the second isn't
MsgBox ""
' we might as well show them the new numbers
Application.ScreenUpdating = True
MsgBox "Your " & LOB & " loss pick is hard coded. When you change the Loss Rating Limit you have to change your pick.", vbExclamation, "Reminder To Change " & LOB & " Loss Pick"
End If
SendKeys "{ESC}"
End If
End If
End Sub


Don <www.donwiss.com (e-mail link at home page bottom).


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

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