vb 如何简单的选择一个文件名

如下:在vba能运行,但是在vb运行的时候提示:要求对象!请问如何解决?还有更好的选择文件的方法么?
'On Error Resume Next
With Application.FileDialog(msoFileDialogFilePicker)
If .Show = -1 Then
file_pathname = .SelectedItems(1)
End If
End With

作者: hwbdabao1234   发布时间: 2011-06-17

使用 CommonDialog 控件。

Me.Comdlg1.ShowOpen
MsgBox Comdlg1.FileName

作者: caozhy   发布时间: 2011-06-17