Hello,
seems simple but ...
I created a dummy query ... with the name Q_exporteren
Then i changed the code like:
CurrentProject.connection.Querydefs("Q_exporteren").Sql = strSQL
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Q_exporteren", strPath
Then I get an error wrong...