title: Export MS Access 2010 table to Excel 2010
body: <p>I'm having problems with a bit of code which exports a table from MS Access 2010 in Excel 2010 format. The code runs fine in Access and the file is created. However, when I try to open the file in Excel 2010  I receive an error message as follows:</p>
  
  <p>Excel cannot open the file because the file format or file extension is not valid.</p>
  
  <p>Here's the code</p>
  
  <pre><code>      DoCmd.TransferSpreadsheet transfertype:=acExport, _
        spreadsheettype:=acSpreadsheetTypeExcel12, _
        TableName:="Table1", FileName:="C:\MyDocuments\Myfile.xlsx"
  </code></pre>
  
  <p>Many thanks in advance</p>
  
  <p>M</p>