TransferSpeadsheet help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi. I'm writing a procedure that will create a temporary table, and then
export that table to Excel. I keep getting an error on the
TransferSpreadsheet line of code. Here's the line that's generating the error.

DoCmd.TransferSpreadsheet acExport, , [Temp Revenue Template], strPath &
strFile

The error message states:
Run-time error '2465'
Microsoft Access can't find the field '|' referred to in your expression.

The path & filename variables create a valid filename. The [Temp Revenue
Template] table has been created correctly, and all the field names are
valid. I can't figure out what's generating the error. Any thoughts?
 
Try this:

DoCmd.TransferSpreadsheet acExport, , "Temp Revenue Template", strPath &
strFile

The table name should be presented as a text string.
 
Thanks Ken. That did it.

Ken Snell said:
Try this:

DoCmd.TransferSpreadsheet acExport, , "Temp Revenue Template", strPath &
strFile

The table name should be presented as a text string.
--

Ken Snell
<MS ACCESS MVP>



mike said:
Hi. I'm writing a procedure that will create a temporary table, and then
export that table to Excel. I keep getting an error on the
TransferSpreadsheet line of code. Here's the line that's generating the error.

DoCmd.TransferSpreadsheet acExport, , [Temp Revenue Template], strPath &
strFile

The error message states:
Run-time error '2465'
Microsoft Access can't find the field '|' referred to in your expression.

The path & filename variables create a valid filename. The [Temp Revenue
Template] table has been created correctly, and all the field names are
valid. I can't figure out what's generating the error. Any thoughts?
 
Back
Top