0

This is my code again. Using this code i have .xls file which can store up to 65k rows, but i need more. I know, that Excel file from version 2007 can store 1 mln rows. Do I need to add special library to save file in .xlsx or what?

//------------------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();

1 Answer 1

2

I believe that Excel.XlFileFormat.xlOpenXMLWorkbook is the most recent format.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.