Hi. Just as a test, could you please try the following steps?
1. Press Ctrl+G
2. Type the following and hit Enter:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12xml, "Consulta2", CurrentProject.Path & "\Consulta2.xlsx", True
3. Close or minimize Access and then look in the same folder for a file called "Consulta2.xlsx" or tell us if you got an error with the above.