Skip to main content
Question

Excel Macro Pop up Issue

  • December 18, 2023
  • 2 replies
  • 272 views

Forum|alt.badge.img+5
  • Navigator | Tier 3
  • 22 replies

Hi Guys,

 

I am executing a macro using the “Run Macro” command in the Excel Advanced package & facing an issue where the macro is getting executed without any issues but at the end a dialog box comes up which indicates that the macro was successfully executed. It is due to the MsgBox command present at the end of the macro code. 

When the pop up comes up, it does not closes automatically as well as the subsequent lines of code do not get executed in AA & the the code is stuck at “Run Macro” command till someone manually click on the OK button of the dialog box.

 

Can anyone please help me to overcome this issue?

2 replies

Abhay Naik
Forum|alt.badge.img+7
  • Navigator | Tier 3
  • 98 replies
  • December 18, 2023

Hi @Abhi25 , 

The best solution for you here is to remove the MsgBox action from the Macro code. Else you can try wait and recorder to wait for the window to pop up and then click on the button present in the MsgBox to remove it.

 

Hope this helps!


HemanthaPindra
Forum|alt.badge.img+5
  • Navigator | Tier 3
  • 21 replies
  • June 13, 2024

Hi @Abhi25,

 

I know it's quiet late reply, may be useful to someone.

 

You have to use Application.DisplayAlerts property. Setting it to False it will prevent Excel from displaying most dialog boxes and alerts.

 

Application.DisplayAlerts = False

' Your code here

Application.DisplayAlerts = True ' Reset back to default

 

Regards,

Hemantha Pindra

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings