[英]How to create .xlsx file for Excel version 2010 in c#?
This is my code again. 这是我的代码。 Using this code i have .xls file which can store up to 65k rows, but i need more.
使用此代码我有.xls文件,可以存储多达65k行,但我需要更多。 I know, that Excel file from version 2007 can store 1 mln rows.
我知道,2007版的Excel文件可以存储1百万行。 Do I need to add special library to save file in .xlsx or what?
我是否需要添加特殊库来保存.xlsx中的文件或者什么?
//------------------Create Excel App--------------------
Excel.Application xlApp;
Excel.Workbook xlWorkBook;
Excel.Worksheet xlWorkSheet;
object misValue = System.Reflection.Missing.Value;
xlApp = new Excel.Application();
xlWorkBook = xlApp.Workbooks.Add(misValue);
xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(numberOfLetters);
foreach (string letter in letters)
{
xlWorkSheet.Cells[rowIndex, 1] = letter;
rowIndex++;
}
xlWorkBook.SaveAs(pathXL, Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue, Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);
xlWorkBook.Close(true, misValue, misValue);
xlApp.Quit();
我相信Excel.XlFileFormat.xlOpenXMLWorkbook是最新的格式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.