Showing MsgBox after Control Toolbar macro runs

D

Don Wiss

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).
 
D

Don Wiss

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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top