[英]Export MS Access 2010 table to Excel 2010
I'm having problems with a bit of code which exports a table from MS Access 2010 in Excel 2010 format. 我遇到了一些代码问题,这些代码从MS Access 2010以Excel 2010格式导出表格。 The code runs fine in Access and the file is created.
该代码在Access中运行良好,并创建了文件。 However, when I try to open the file in Excel 2010 I receive an error message as follows:
但是,当我尝试在Excel 2010中打开文件时,收到如下错误消息:
Excel cannot open the file because the file format or file extension is not valid. Excel无法打开文件,因为文件格式或文件扩展名无效。
Here's the code 这是代码
DoCmd.TransferSpreadsheet transfertype:=acExport, _
spreadsheettype:=acSpreadsheetTypeExcel12, _
TableName:="Table1", FileName:="C:\MyDocuments\Myfile.xlsx"
Many thanks in advance 提前谢谢了
M 中号
请改用acSpreadsheetTypeExcel12Xml
,因为acSpreadsheetTypeExcel12
可能会导致版本问题(不一致)...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.