Updating links with auto updating

syndee

New Member
Joined
Jan 14, 2017
Messages
18
My Control File contains several worksheets.
It links to data in other files in same folder.
Just having problem with updating links with auto updating and returning to Control File.xlsm
Tried this but need files to save and close except Control File.xlsm after updating.
Is that possible?

Private Sub Workbook_Open()

Application.ScreenUpdating = False

ActiveWorkbook.UpdateLinks = xlUpdateLinksAlways
Workbooks.Open Filename:= _
"C:\Users\Cindy\Desktop\Excel-Trial File to eliminate pasting\File 2.csv"
Workbooks.Open Filename:= _
"C:\Users\Cindy\Desktop\Excel-Trial File to eliminate pasting\File 1.csv"

Application.ScreenUpdating = True

End Sub
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Try This......

Code:
Private Sub Workbook_Open()
Workbooks.Open Filename:= _
"C:\Users\Cindy\Desktop\Excel-Trial File to eliminate pasting\File 2.csv" _
, UpdateLinks:=3
ActiveWorkbook.Save
ActiveWindow.Close
Workbooks.Open Filename:= _
"C:\Users\Cindy\Desktop\Excel-Trial File to eliminate pasting\File 1.csv" _
, UpdateLinks:=3
ActiveWorkbook.Save
ActiveWindow.Close
End Sub
 
Last edited:
Upvote 0
Only problem when I put folder into another folder the location doesn't change. This folder will be used in many company folders. Anyway to tell it files are all in same folder regardless where it is located. Linked files will always be named File 1.cs & File 2.csv. Just location of folder will change.
 
Upvote 0
If the files are going to be in a shared location, you would simply update the file location with the shared drive info. If the files are going to be on each users desktop, try the following:

Code:
Private Sub Workbook_Open()
Workbooks.Open Filename:= _
"C:\Users\" & Environ("UserName") & "\Desktop\Excel-Trial File to eliminate pasting\File 2.csv" _
, UpdateLinks:=3
ActiveWorkbook.Save
ActiveWindow.Close
Workbooks.Open Filename:= _
"C:\Users\" & Environ("UserName") & "\Desktop\Excel-Trial File to eliminate pasting\File 1.csv" _
, UpdateLinks:=3
ActiveWorkbook.Save
ActiveWindow.Close
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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