我加载了类似的Excel工作表
WorkB = ExcelApp.Workbooks.Open(My.Computer.FileSystem.CurrentDirectory & "ExcelForm.xls")
但现在我想通过对话框(OpenFileDialog)选择路径来加载文件。我怎样才能使它成为可能?
试试这个:
Dim ofd As New OpenFileDialog
If ofd.showdialog = dialogresult.ok then
WorkB = ExcelApp.Workbooks.Open(ofd.filename)
End If