Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Output to" Excel 2010

Status
Not open for further replies.

ICCIIT

Technical User
Jul 21, 2003
62
GB
I am using the following "output to" line but when I try to open the resulting spreadsheet it gives an "incorrect file format" error although it clearly displays it as an Excel.xlsx file.

Using Access 2010 / Excel 2010

Code:
DoCmd.OutputTo acTable, "tblData", acFormatXLS, "s:\Data".xlsx", , ""

I then tried the old format (which works) but that opens the spreadsheet in Compatibility mode rather than full 2010.

Code:
DoCmd.OutputTo acTable, "tblData", "MicrosoftExcel(*.xls)", "s:\Data".xls", , ""

Are there better ways of doing this?

Thanks
 
Its ok... my mistake it should be acFormatXLXS

doh....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top