Bulk changing links to external workbooks that dont yet exist

hosteen

New Member
Joined
Jan 12, 2011
Messages
5
I need to change the text in a large number of links to external workbooks. This is a monthly task and sometimes the workbooks I reference have yet to be created. This means if I use Find and Replace to change part of the text string in the links the update values dialogue will appear and end the Find and Replace process. I tried using a macro to find and replace but this still results in me having to press cancel hundreds of times for all of the workbooks linked to that have not yet been created. Is there a way to suppress this dialogue box. I’ve searched extensively but the solutions offered have not worked. Happy with a VBA solution or anything to be honest.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Ah, I've solved it, in case anyone else is looking, I found this solution elsewhere but I think it originally came from somewhere within Mr Excel.

Made bold the Pertinent bits of code

Sub FindReplaceAll()

ThisWorkbook.UpdateLinks = xlUpdateLinksNever
Application.DisplayAlerts = False


Dim sht As Worksheet
Dim fnd As Variant
Dim rplc As Variant

fnd = "201809"
rplc = "201810"

For Each sht In ActiveWorkbook.Worksheets
sht.Cells.Replace what:=fnd, Replacement:=rplc, _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, _
SearchFormat:=False, ReplaceFormat:=False
Next sht


ThisWorkbook.UpdateLinks = xlUpdateLinksAlways
Application.DisplayAlerts = True


End Sub
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

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