Sub GetMostRecentFile()
Dim FileSys As FileSystemObject
Dim objFile As File
Dim myFolder
Dim strFilename As String
Dim dteFile As Date
'set path for files - change for your folder
Const myDir As String = "Z:\SolidWorks\Solidworks System Files\Databases\Klanten-Database NAV"
'set up filesys objects
Set FileSys = New FileSystemObject
Set myFolder = FileSys.GetFolder(myDir)
'loop through each file and get date last modified. If largest date then store Filename
dteFile = DateSerial(1900, 1, 1)
For Each objFile In myFolder.Files
If objFile.DateLastModified > dteFile Then
dteFile = objFile.DateLastModified
strFilename = objFile.Name
End If
Next objFile
Debug.Print myDir & "\" & strFilename
'Workbooks.Open strFilename
Workbooks.Open myDir & "\" & strFilename, False, True
Set FileSys = Nothing
Set myFolder = Nothing
End Sub