Dim fdg As FileDialog
Set fdg = Application.FileDialog(msoFileDialogFilePicker)
fdg.Filters.Add "Text Documents", "*.dat", 1
While fdg.Filters.Count > 1
fdg.Filters.Delete 2
Wend
With fdg
.AllowMultiSelect = False
.InitialFileName = "c:\"
.InitialView = msoFileDialogViewDetails
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems 'onby be 1
strSelectedFile = vrtSelectedItem
Next vrtSelectedItem
Else
End If
End With
Set fd = Nothing
If Not IsEmpty(strSelectedFile) Then
Filenametxt = strSelectedFile
End If
问问题
220 次