The sentence
at the end of the code below, what is its role?
Sub test()
Dim sPath As String
Dim sFil As String
Dim FolderPath As String
Dim diaFolder As FileDialog
Set diaFolder = Application.FileDialog(msoFileDialogFolderPicker)
diaFolder.AllowMultiSelect = False
diaFolder.Show
FolderPath = diaFolder.SelectedItems(1)
sPath = FolderPath & "\" 'location of files
'MsgBox "FolderPath: " & FolderPath & ";" & "sPath: " & sPath
sFil = Dir(sPath & "*.xls")
Do While sFil <> ""
Set oWbk = Workbooks.Open(sPath & "\" & sFil, 0)
oWbk.Close
sFil = Dir
Loop
End Sub
Thanks!!
Bookmarks