【发布时间】:2021-09-13 06:45:24
【问题描述】:
我正在尝试将 excel 中的指定表导入 Access。一旦用户将 Excel 电子表格中的数据转换为表格,我就知道数据应该是干净的,没有子标题和合并的单元格。但是,在使用 Sub
'''
Public Sub ImportExcelSpreadsheet(FileName As String, tableName As String, Range As String)
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, tableName, FileName, True, Range
End Sub
'When I try to run the sub the values are as follows
ExcelImport.ImportExcelSpreadsheet Me.txtFileName, FSO.GetFileName(Me.txtFileName), "tbl_IOList[#All]" 'Where tbl_IOList[#All] is the range
我在输入范围为“$A$1:$L$116”时已经成功,但它不适用于“tbl_IOList[#All]”
【问题讨论】:
-
您是否尝试将
"tbl_IOList[#All]"替换为Range("tbl_IOList[#All]").Address?