【发布时间】:2015-06-19 13:25:53
【问题描述】:
我正在尝试使用简单的 MsgBox 打印选定的文件名以进行调试。 msoFileDialogOpen 允许用户选择文件。我正在尝试打印所选文件的文件名。
' Start File Explorer to select file containing data
Dim lngCount As Long
' Open the file dialog
With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = True
.Show
' Display paths of each file selected
For lngCount = 1 To .SelectedItems.Count
MsgBox .SelectedItems
Next lngCount
End With
当我运行它时,我收到错误消息“运行时错误'450':参数数量错误或属性分配无效”。
【问题讨论】:
标签: vba excel excel-2010