Soapbox on
Macros are a legacy left over from Version 1.0.
They should never be used, except in VERY limited circumstances.
They are very limited , and can cause all sorts of problems
Move the TransferSpreadsheet macro to code
The syntax is
DoCmd.TransferSpreadsheet [transfertype][, spreadsheettype],
tablename, filename[, hasfieldnames][, range]
For all details look up the help file
Your code will ned up looking like...
Sub GetSpreadsheet ()
dim strFileName as string
strString = NZ(InputBox, "Enter a fileName")
Docmd.TransferSpreadSheet AcImport, acSpreadsheetTypeExcel8, _
"tblDestination", strFileName
end Sub
You can get very sophisticated with your input box. It is even
possibly to use the Windows FileOpen Dialog box to choose it
You can also alter the Spreadsheet type dynamically,(or progressively
until one works!), but I leave these wrinkles as an exercise for the
reader.
>
HTH
Regards Greg Kraushaar
Wentworth Falls Australia
(Do not email - the reply address is a Spam spoofer)
(If you really must, remove all UCase and numbers)
Move it to Code