I am trying to transfer data from Access (latest version) to Excel. The transfer has worked for a long time and works OK until I add two fields to the source query (q_Excel_Export_2). The message I get is shown below. I just can't figure it out.
The message:
RUN TIME ERROR '3420'
OBJECT INVALID OR NO LONGER SET
The stop occurs at the third line.
Dim exfile As String
exfile = CurrentProject.Path & "" & .ExcelFile
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "q_Excel_Export_2", exfile, -1
Any help much appreciated