调用access自带的“获取外部数据”功能,
2003可以用
DoCmd.RunCommand acCmdImport
2007/2010/2013/2016用
DoCmd.RunCommand acCmdImportAttachAccess
DoCmd.RunCommand acCmdImportAttachdBase
DoCmd.RunCommand acCmdImportAttachExcel
DoCmd.RunCommand acCmdImportAttachHTML
DoCmd.RunCommand acCmdImportAttachODBC
DoCmd.RunCommand acCmdImportAttachOutlook
DoCmd.RunCommand acCmdImportAttachSharePointList
DoCmd.RunCommand acCmdImportAttachText
DoCmd.RunCommand acCmdImportAttachXML
效果如下: