我不知道为什么Excel库会支持xlsx文件,因为它支持Excel 2007.但是,这很容易修复。
您可以绕过Excel库并直接使用Excel ActiveX自动化(Excel库不支持Excel可以执行的所有操作)并以xlsx格式保存工作簿。只需添加一个公式:xlApp.Workbooks(1).SaveAs(“x
.xlsx“)这将在xlsx文件中保存您的第一个(也可能是唯一的)工作簿.xlApp变量保存Excel库创建的Excel Application对象。
以上来自于谷歌翻译
以下为原文
I dont know why the Excel library doent support xlsx files since it supports Excel 2007.
However, this is easy to fix. You can by-pass the Excel library and use Excel ActiveX automation directly (the Excel library doesnt support everything Excel can do) and save the workbook in xlsx format.
Just add a Formula with: xlApp.Workbooks(1).SaveAs("x.xlsx") This will save your first (and probably only) workbook in a xlsx file.
The xlApp variable hold the Excel Application object created by the Excel library.
我不知道为什么Excel库会支持xlsx文件,因为它支持Excel 2007.但是,这很容易修复。
您可以绕过Excel库并直接使用Excel ActiveX自动化(Excel库不支持Excel可以执行的所有操作)并以xlsx格式保存工作簿。只需添加一个公式:xlApp.Workbooks(1).SaveAs(“x
.xlsx“)这将在xlsx文件中保存您的第一个(也可能是唯一的)工作簿.xlApp变量保存Excel库创建的Excel Application对象。
以上来自于谷歌翻译
以下为原文
I dont know why the Excel library doent support xlsx files since it supports Excel 2007.
However, this is easy to fix. You can by-pass the Excel library and use Excel ActiveX automation directly (the Excel library doesnt support everything Excel can do) and save the workbook in xlsx format.
Just add a Formula with: xlApp.Workbooks(1).SaveAs("x.xlsx") This will save your first (and probably only) workbook in a xlsx file.
The xlApp variable hold the Excel Application object created by the Excel library.
举报