Private Sub Command0_Click() Dim tableName, excelFile As String '取得同層目錄下的rawData.xlsx路徑 excelFile = CurrentProject.Path & "\" & "rawData.xlsx" 'table名稱 tableName = "test" DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, tableName, excelFile, True '關閉可能已開啟的table DoCmd.Close acTable, tableName '開啟table DoCmd.OpenTable tableName MsgBox "匯入成功!" End Sub
沒有留言:
張貼留言