开发者

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 Exc开发者_Python百科el 2007 Interop save workbooks in compatibility mode ?

Thanks!


Save workbook as http://msdn.microsoft.com/en-us/library/bb214129%28v=office.12%29.aspx with Format http://msdn.microsoft.com/en-us/library/bb241279%28v=office.12%29.aspx

Excel 2003 is probably xlExcel8 http://www.rondebruin.nl/saveas.htm


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜