Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

dont update link

ResolvedVersion 2010

Mark has attended:
Excel VBA Intro Intermediate course
Excel Advanced - For Power Users course
Excel PowerPivot course
Excel Dashboards for Business Intelligence course

Don't Update Link

I've stolen a sub routine which will go through a file path, open each file individually apply another subroutine save and close the file and move onto the next file.

However, when opening each individual file I get prompted to either Update or Don't Update links. What piece of code do I need to select Don't Update automatically and then apply the subroutine.

Sub AllFiles()

Dim folderPath As String
Dim filename As String
Dim wb As Workbook

folderPath = "G:\Network Operations Team\2014\MBPC\Network Capacity\Test\"

If Right(folderPath, 1) <> "\" Then folderPath = folderPath + "\"

filename = Dir(folderPath & "*.xlsm")
Do While filename <> ""
Application.ScreenUpdating = False
Set wb = Workbooks.Open(folderPath & filename)

Call Part1

filename = Dir

Loop

Application.ScreenUpdating = True

MsgBox "Patch Applied"

End Sub



Thanks,
Mark

RE: Don't Update Link

Hi Mark

Well done finding the code.

There is a way to stop the update or don't update links message appearing. Include the optional parameter UpdateLinks for the Workbooks.Open method.

Edit the line starting Set wb to...

Set wb = Workbooks.Open(folderPath & filename, UpdateLinks:=0)

If you change your mind and want to update the links Use UpdateLinks:=3 instead.

Thanks for the question, this was a new one for me! Please can you let me know if it works on your files, thanks.

Doug Dunn
Best STL

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Creating Quick Column Charts

Select the information you want to appear in the chart and press F11. This creates a new chart on a seperate worksheet.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.