VBA: Can I suppress Select Sheet dialog box

hellsreach

New Member
Joined
Dec 22, 2015
Messages
19
I have a script that uses a Replace to change one link to another sheet in a different file. No matter what I do, the script gives me a Select Sheet dialog box because it cannot find the tab in question (it doesn't exist yet). If I hit "Cancel" is cancels that dialog box and I get a #Ref error which I 100% ok with. Neither Application.DisplayAlerts = False, Application.AskToUpdateLinks = False solves the issue. Unfortunately, I do this replace on dozens of links, so hitting cancel over and over it completely stupid.

What I WANT is to automatically default to Cancel. Can I do that? Like I said, I'm fine with the error. The sheet in question doesn't exist yet, but will in to days following the "rolling." script.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
36,706
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
Is calculation set to manual?
 

Watch MrExcel Video

Forum statistics

Threads
1,129,760
Messages
5,638,203
Members
417,014
Latest member
dualwieldbacon

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