title: Export of a report in Access 2013 VBA to Excel works wrong, different from built-in export
body: <p>Was wondering if anyone has encountered this problem. I'm working on an Access 2013 database which produces a couple of reports. These reports need to be exported into Excel files. I do this in VBA by using   </p>
  
  <pre><code>DoCmd.OutputTo acOutputReport, "ReportName", acFormatXLS, "fileName.xls"  
  </code></pre>
  
  <p>The files are created, however, their contents don't look as expected, especially when compared to the resulting XLSX files obtained by running the built-in Access' "External Data"->"Export to Excel spreadsheet" function.<br>
  For example, in one of the files, the rows of the table obtained by running report's row source query do not advance, resulting in multiple repetitions of the same row. In the other one the formatting is wrong.<br>
  Again, when exporting using the Access built-in "Export to Excel" function, the results are correct.<br>
  Question: is there an alternate method of exporting reports to Excel? Am I doing something wrong?<br>
  Thanks!  </p>
  
  <p>EDIT: just to clarify: the formatting is only a secondary problem. The data itself is saved wrong. The main problem is that starting with a certain row, the rest of the rows are only copies of that row, they do not advance.</p>