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