dont update link

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

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Don't Update Link

Don't Update Link

resolvedResolved · High Priority · Version 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:

Display pictures on Chart Data Point

Replacing a single chart data point bar with a picture.
Step 1: Left click on a bar. Then, wait, and do a second single click on the bar. This will select just one data point.

Step 2: Right click on the bar and select Format Data Point.

Step 3: On the fill effects tab, choose a picture. Browse for a picture for that bar. Indicate if you want it to be stretched or stacked. Repeat for each bar.

View all Excel hints and tips


Server loaded in 0.09 secs.