小编use*_*866的帖子

使用FileDialog打开工作簿并在Excel VBA中对其进行操作

我正在学习如何使用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文件?

excel vba openfiledialog excel-vba

13
推荐指数
2
解决办法
11万
查看次数

标签 统计

excel ×1

excel-vba ×1

openfiledialog ×1

vba ×1