Forum Discussion
Shashikant Koti
Jul 31, 2018Copper Contributor
Excel 2016 Help window pops up automatically when I call msgbox in VBA
Excel 2016 Help window pops up automatically when I call Msgbox. I have called the Msgbox in the Worksheet_Activate function. Immediately after the Msbox is displayed, along with Msgbox, Excel 2016 H...
Haytham Amairah
Jul 31, 2018Silver Contributor
This is a strange issue!
I tried to reproduce the code on my own but the Excel 2016 help window didn't pop up!
Typically, it pops up when you press F1.
Shashikant Koti
Jul 31, 2018Copper Contributor
Thanks Haytham for your comments. I also copied the same code in different sheet and was not able to replicate. If I remove the msgbox then this issue goes away. Happens only on my current excel sheet.
- Shashikant KotiJul 31, 2018Copper Contributor
Is there is setting in excel which will prevent "Excel 2016 Help" window popping up.
- Haytham AmairahAug 01, 2018Silver Contributor
Sorry, I have no idea about that!
But, try to update the code as follows:
Dim MsgSW2 As Boolean
Private Sub Worksheet_Activate()
If MsgSW2 Then Exit Sub
Application.DisplayAlerts = False
Application.EnableEvents = False
If Range("CatchSW").Value = False Then
MsgBox "Please remember to update the data in the Section"
MsgSW2 = True
CommandButton1.Visible = True
Else
CommandButton1.Visible = False
End If
Application.DisplayAlerts = True
Application.EnableEvents = True
End SubThis might fix the issue!
Regards
- Shashikant KotiAug 01, 2018Copper Contributor
Thanks Haytham for your response.
I tried the code shared by you. But I still get the pop up. I also did try to place the DisplayAlerts and Enable events in different places , but still getting the error.