7

While my macro runs, I do my other works. But then when msgbox pops out stays behind my other windows.

How can I see it on top, when it pops out?

Thank you.

Community
  • 1
  • 1
Emre
  • 121
  • 1
  • 2
  • 8
  • Put this line before the msgbox code AppActivate Application.Caption? Solutions discussed here https://www.mrexcel.com/forum/excel-questions/66245-ensure-msgbox-pops-up-top.html – QHarr Jun 08 '18 at 06:55

2 Answers2

10

add system modal parameter vbSystemModal:

MsgBox "Your message!", vbSystemModal
JC Guidicelli
  • 1,296
  • 7
  • 16
  • 1
    https://msdn.microsoft.com/en-us/vba/language-reference-vba/articles/msgbox-function – Mihai Adrian Jun 08 '18 at 06:59
  • If your button has a defined style, you can also add `vbSystemModal` there, like `Style = vbOKOnly Or vbSystemModal` (this would make an Ok button come up in front of other windows) – Randcelot Aug 24 '23 at 14:57
-1

Add an exclamation mark to the message:

MsgBox "Your message!",6 +vbSystemModal, "Title of Msg..."