How to skip microsoft excel message box?

Hello there,

I have a workflow that extracts the names of all hidden sheets. The workflow seems to work fine until a notification popped up from one of the excel files. The bot is then hanging and can’t proceed further to the next activity.

I am wondering what should i add in my workflow so that the bot can close/ escape any microsoft excel message box? The screenshot is just an example, the message box can show different warnings for different files. I wish to make the bot to ignore any messages and proceed with workflow as my main objective is just to get the hidden sheet names.

image

Hi @WS_Chai ,

Since you are using VBA, you could try setting the alerts to false:

Application.DisplayAlerts = False

And set it back to True towards the end of the automation.

Kind Regards,
Ashwin A.K

Hi @ashwin.ashok,

Thanks for your reply.

May I clarify where and how to set this alert?
Do I include it in my VBA script or add an activity?

Hi @WS_Chai ,

Yep, have to include it into your VBA.
Give it a try and let me know if it works out.

Kind Regards,
Ashwin A.K

Sorry, do you mind guiding me where should i add “Application.DisplayAlerts = False” and “Application.DisplayAlerts = True” in the macro script?

Hi @WS_Chai ,

You can set the property display alerts to false in excel process scope container.

Under options first property is display alerts.

Hope this helps.

Thanks,
Gautham.

Hi @WS_Chai ,

Could you add it before the For Each ws In ActiveWorkbook.Worksheets?

Kind Regards,
Ashwin A.K

Hi @Gautham_Pattabiraman

Where can I find the display alerts property?
I think I didn’t see it under excel application scope

Hi @ashwin.ashok,

I added “Application.DisplayAlerts = False” before the For Each ws In ActiveWorkbook.Worksheets.
Seems like it is still hanging there

Hi @WS_Chai ,

Please add the snippet to both functions.
Let it be the first line of code for both.

Kind Regards,
Ashwin A.K

Hi @WS_Chai ,

I think you are using classic activity Excel Application scope. Please try using the excel process scope activity,

Once you make use of the Excel Process Scope activity.
You should be able to get the display alerts property as shown in the snap above. There you can set it to false to overcome this issue.

Note : To enable the Modern design, navigate to projects pane, locate the settings icon under general tab of settings pop up you can find the toggle for modern design, enable it to leverage modern activities in your project.

Thanks,
Gautham.