VBA How to disable the following dialogs when running a macro

Palucci

Board Regular
Joined
Sep 15, 2021
Messages
94
Office Version
  1. 365
Platform
  1. Windows
Guys !

When I run the macro, I have this message at the beginning.

This workbook contains links to other external data sources that may be dangerous, if you trust them, update them to get the latest data. Otherwise, you can also keep working with the current data.
do not update

I would like this answer to be marked automatically for me " Do not updated " i think its related to Update links.
And second one, i would like always select No. Is there some chance of setting this up
There is a lot of information in the clipboard. Do you want to be able to paste this information into another program later
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
13,936
Office Version
  1. 2007
Platform
  1. Windows
Add these lines to the start of your macro

VBA Code:
  Application.ThisWorkbook.UpdateLinks = xlUpdateLinksNever '2
  Application.DisplayAlerts = False
 

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
13,936
Office Version
  1. 2007
Platform
  1. Windows
There is a lot of information in the clipboard.

If that happens when you close the book, then put the following in the ThisWorkbook events

VBA Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
  Application.CutCopyMode = False
End Sub
 
Solution

Forum statistics

Threads
1,148,020
Messages
5,744,364
Members
423,864
Latest member
GolfingTitan116

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
Top