Public Function UserPick1File(byval pvPath)
Dim strTable As String
Dim strFilePath As String
Dim sDialogMsg As String, sDecr As String, sExt As String
'const msoFileDialogFilePicker = 3
If IsMissing(pvPath) Then pvPath = "c:\" ' getMyDocs()
'SetFileFilter pvFilter, sDecr, sExt, sDialogMsg
With Application.FileDialog(3)
.AllowMultiSelect = True
.Title = sDialogMsg ' "Locate a file to Import"
.ButtonName = sDialogMsg '"Import"
.Filters.Clear
'.Filters.Add sDecr, sExt
'.Filters.Add "Access Files", "*.accdb;*.mdb"
'.Filters.Add "Excel Files", "*.xlsx"
.Filters.Add "All Files", "*.*"
.InitialFileName = pvPath
.InitialView = msoFileDialogViewList 'msoFileDialogViewThumbnail
If .show = 0 Then
'There is a problem
Exit Function
End If
'Save the first file selected
UserPick1File = Trim(.SelectedItems(1))
End With
End Function
Public Function getModifiedDate(ByVal pvFile)
Dim fs, f, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(pvFile)
getModifiedDate = f.DateLastModified
Set f = Nothing
Set fs = Nothing
End Function
Public Function getCreatedDate(ByVal pvFile)
Dim fs, f, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(pvFile)
getCreatedDate = f.DateCreated
Set f = Nothing
Set fs = Nothing
End Function