从Excel导入数据到MS Access

我有一个有一些数据的excel文件,我需要使用VBA将所有的数据导入到MS Access中,然后在其上运行一个查询,最后在报告中显示数据。 这怎么能成为现实呢?

参考: http : //office.microsoft.com/en-in/excel-help/import-excel-data-to-an-access-database-HP005200852.aspx

确保Microsoft Excel数据是列表格式:每列在第一行中都有一个标签,并且包含相似的事实,列表中没有空行或列。

Close the Excel workbook that contains the data you want to use in Microsoft Access. In Access, open the database where you want to copy the Excel data. On the Access File menu, point to Get External Data, and then click Import. In the Import dialog box, click Microsoft Excel in the Files of type box. In the Look in list, locate the file you want to import, and then double-click the file. Follow the directions in the Import Spreadsheet Wizard. 

谢谢

如下所示使用docmd.transterspreadsheet:

 DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12Xml,tblName, impPath, False, impSheet where tblName is table to add data to impPath is path and file name of excel workbook to import from false = no field names in import area (true =field name included in import area) sheet = sheet name and range ie "sheet!b5:j15"