我正在学习如何使用Excel宏,我发现这个代码:
Dim fd As Office.FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
.AllowMultiSelect = False
.Title = "Please select the file to kill his non colored cells"
.Filters.Add "Excel", "*.xls"
.Filters.Add "All", "*.*"
If .Show = True Then
txtFileName = .SelectedItems(1)
End If
End With
Run Code Online (Sandbox Code Playgroud)
此代码打开FileDialog.如何在不重写先前打开的情况下打开所选的Excel文件?