VBA: Remove update links in source data.

MrActuary

Board Regular
Joined
Jun 18, 2004
Messages
73
I have a macro that reads in an array of Excel files then processes each file before moving onto the next with the following code to select the array and open it:

Pth = Application.GetOpenFilename("excel files, *.xls", MultiSelect:=True)

For i = LBound(Pth) To UBound(Pth)
On Error Resume Next
If Pth <> "False" Then Workbooks.Open Pth(i)

Acct = ActiveWorkbook.Name


The problem is that many of the files contained in the Pth(i) array have links to external data sources which pauses the macro with the pop-up "update links" message. Is it possible to insert code that will tell the macro to automatically NOT update links in these external files? I know that Application.DisplayAlerts = False does this, but this seems to only work for the workbook running the macro and not these external files being read in. Any help is appreciated.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Try this

If Pth <> "False" Then Workbooks.Open Pth(i), UpdateLinks:=False

Hope that helps...
 
Upvote 0
No problem...

I'm not sure though, you may need to reset that to TRUE before Saving/Closing that file...

workbooks("x.xls").UpdateLinks = xlUpdateLinksAlways
 
Upvote 0

Forum statistics

Threads
1,213,494
Messages
6,113,974
Members
448,537
Latest member
Et_Cetera

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