Automatic OK

hasanlianar

New Member
Joined
Jul 21, 2011
Messages
43
Hi,

In Excel I created several tables over Power Query by connecting to web sites.
I have set tales Refresh every 30 minutes. But sometimes the web sites do not respond and message box appears about it.
Can I configure Excel to automatically click on OK button so that it disappears immediately or do not pop up at all?

I have read several posts on this, but could not find appropriate solution.

Thank you,
Anar
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
With Application
.DisplayAlerts = True
.EnableEvents = True
End With
End Sub

Private Sub Workbook_Open()
With Application
.DisplayAlerts = False
.EnableEvents = False
End With
End Sub

try the below in the ThisWorkbook object in VBA. make sure its in the ThisWorkbook object
 
Upvote 0
BarryL, thank you. But this code will work only for workbook Close and Open events. My work book stays open the whole day and sometimes, as I stated above, message box pops up due to that Excel could not connect to web sites.
Is it possible to use similar code for Table Update/refresh event, so that after refresh if something pops up Excel clicks on OK button automatically?
 
Upvote 0

Forum statistics

Threads
1,224,155
Messages
6,176,736
Members
452,741
Latest member
Muhammad Nasir Mahmood

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top