简体   繁体   中英

Creating workbooks with C# and Excel 2007 interop

i'm curently using Excel 2003 to generate reports, but i'm thinking of migrating to Excel 2007. The problem is that some of my users still have Excel 2003 installed on their PCs, so I'll give them the posibility to choose what to generate - Excel 2007 or Excel 2003 compatible report. So my question is : can Excel 2007 Interop save workbooks in compatibility mode ?

Thanks!

See XlFileFormat Enumeration , the right choice is:

FileFormat: Excel.XlFileFormat.xlExcel9795

If this fails under Windows 7 use:

FileFormat: Excel.XlFileFormat.xlWorkbookNormal

Yes it can. Just specify FileFormat parameter (second one) of Workbook.SaveAs() method. You can use any format that is supported by MS Excel. List of supported formats is here: http://msdn.microsoft.com/en-us/library/bb241279(office.12).aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM