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

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
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,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

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