The code below does not work when the first With is marked as remark, any idea?
Thanks
Emily
Thanks
Emily
Code:
Sub DisplayFiles()
Dim FileNames As Variant
Dim i As Integer
'With Application
' .DisplayAlerts = False
' .EnableEvents = False
' .ScreenUpdating = False
'End With
FileNames = Application.GetOpenFilename("Excel Files,*.xls", , , , True)
If IsArray(FileNames) Then
For i = LBound(FileNames) To UBound(FileNames)
MsgBox FileNames(i)
Next i
End If
With Application
.DisplayAlerts = True
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub