I dealt directly with the Excel table as it appears.
Field names and data types are read or interpreted correctly. TransferSpreadsheet for both acImport and acLink will work exactly the same way. So no explicit import specification is necessary, and therefore no saved import, and ultimately no control of the import using the IMEX form.
The SQL statement shown in the code could be used directly in an append query. Entering the path to the Excel file shouldn't overwhelm anyone.
Code:
Sub test_XLFile()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim sSQL As String
Dim i As Long
Dim sFullPath As String
sFullPath = "D:\!!Samples\export1\export1.xlsx"
Set db = CurrentDb
sSQL = "SELECT T.* FROM [excel 12.0 xml;hdr=yes;imex=1;DATABASE=" & sFullPath & "].[Sheet1$] AS T"
Set rs = db.OpenRecordset(sSQL, dbOpenSnapshot)
For i = 0 To rs.Fields.Count - 1
Debug.Print i, rs.Fields(i).Type, rs.Fields(i).Name
Next
rs.Close
End Sub
The SQL statement shown in the code could be used directly in an append query. Entering the path to the Excel file shouldn't overwhelm anyone.