Thank you for the answer, but the things are not quite easy for me.
Yes , I would like to export data in xls files.
Refering my above example if my table has many records I cannot use
DoCmd.OutputTo acOutputQuery, "qryMyQuery1", acFormatXLS, "C:\MyLocation\aaaa.xls"
DoCmd.OutputTo...