DutchKevin
Board Regular
- Joined
- Apr 13, 2011
- Messages
- 133
- Office Version
- 365
- Platform
- Windows
Hello,
I'm looking for a way to refresh the "ABC file" that my workbook is linked to.
The new ABC file will always be in the same folder and have specific naming convention. Like "ABC Week2013_03.xlsm"
My workbook also has links to other files, but these remain unchanged.
So far i've been able to come up with:
Can anyone suggest a way to make the current ABC file name into a variable? It has always a certain filenaming format ("ABC Week2013_03.xlsm") so it must be quite easy to filter out of the linked files list. But How??
Thanks in advance
Kevin
I'm looking for a way to refresh the "ABC file" that my workbook is linked to.
The new ABC file will always be in the same folder and have specific naming convention. Like "ABC Week2013_03.xlsm"
My workbook also has links to other files, but these remain unchanged.
So far i've been able to come up with:
Code:
Sub UpdateABC()
Set ThisBook = ActiveWorkbook
ChDrive "S:\"
ChDir "S:\ABC files\"
LatestDTR = Application.GetOpenFilename(Title:="Please choose the most recent ABC file", FileFilter:="XLS Files *.xls* (*.xls*),")
If LatestABC = False Then
MsgBox "No file specified.", vbExclamation, "Error"
Else
'Workbooks.Open Filename:=LatestABC 'for checking the file if needed
End If
ThisBook.Activate
ActiveWorkbook.ChangeLink "[COLOR=#ff0000][I]I need a way to get the current linked ABC file name here[/I][/COLOR]", LatestABC, xlExcelLinks
'ActiveWorkbook.UpdateRemoteReferences = True
End Sub
Thanks in advance
Kevin