我正在尝试打开Excel文件,在MS Acesss中,我选择使用FileDialogFilePicker
。但是,当我选择Excel文件时,"打开"提示转向"确定"我无法打开它。有谁知道如何解决这个问题?下面是选择文件的工作代码。
Dim f As FileDialog
Set f = Application.FileDialog(msoFileDialogFilePicker)
f.Show
谢谢!
答案 0 :(得分:0)
以下是最终代码:
Dim f As FileDialog, str As String
Set f = Application.FileDialog(msoFileDialogFilePicker)
f.Show
str = f.SelectedItems(1)
Dim xl As Excel.Application
Set xl = New Excel.Application
xl.Visible = True
xl.Workbooks.Open (str)