I'd put all the Excel files in a common folder, and use VB to navigate to the folder and loop through all the files to either import or link them. The code could add the timestamp from the run time, the file date or the file name - whatever info you want to keep. As an example to help get started, this function navigates to a folder, gets a lists of files, checks the file name for a condition and then imports selected files to a table. It also deletes any Import Error files created in the process, because I know I have one line in each table that won't import.
Function Import_Match_Report()
'On Error Resume Next
'Get folder & file list
Dim Source_folder As String
Source_folder = Get_Folder()
Dim FSO As New FileSystemObject
Set flist = FSO.GetFolder(Source_folder).Files
M = InputBox("update period (01-12)")
'delete prior data
CurrentDb().Execute ("delete * from [Matching Report] where period=" & M)
'Process each file
SQL = "INSERT INTO [Matching Report] ([period],[account], [reporting unit],[reporting unit title],[amount],[offset unit],[offset unit title],[offset],[variance]) "
For Each file In flist
If (Len(Dir(Source_folder & "\" & file.Name)) = 0) Then GoTo NextFile
If file.Size = 0 Then GoTo NextFile
Source = file.Name
period = Mid(Source, 7, 2)
If period <> M Then GoTo NextFile
account = Mid(Source, InStr(Source, ".") - 9, 9)
CurrentDb().Execute ("delete * from [matching report temp]")
DoCmd.TransferText acImportDelim, "match_spec", "matching report temp", Source_folder & "\" & file.Name
SQL2 = SQL & " select " & period & ",'" & account & "', F1, F2, F3, F4, F5, F6, F7 from [matching report temp]"
CurrentDb.Execute SQL2
table = Left(Source, InStr(Source, ".") - 1)
If table_exist(table & "_ImportErrors") Then DoCmd.DeleteObject acTable, table & "_ImportErrors"
NextFile: Next file
MsgBox ("data import completed")
End Function
Public Function Get_Folder()
'Create a FileDialog object as a Folder Picker dialog box.
Const msoFileDialogFolderPicker = 4
Const msoFileDialogFilePicker = 3
Const msoFileDialogViewDetails = 2
Set fd = Application.FileDialog(msoFileDialogFolderPicker)
fd.AllowMultiSelect = False
fd.ButtonName = "Select"
fd.InitialView = msoFileDialogViewDetails
fd.Title = "Select Folder"
fd.InitialFileName = "MyDocuments\"
fd.Filters.Clear
'Show the dialog box and get the file name
If fd.Show = -1 Then
Get_Folder = fd.SelectedItems(1)
Else
Get_Folder = "MyDocuments\"
End If
Set fd = Nothing
End Function