1

I'm getting an error when trying to open an Excel Spreadsheet. I am using ExcelLibrary in Visual Studio 2015 and Excel 2010. Am I doing something wrong?

It errors at line 3.


OutOfMemoryException was unhandled

An unhandled exception of type 'System.OutOfMemoryException' occurred in mscorlib.dll Additional information: Array dimensions exceeded supported range.


1     string file = @"C:\\Users\user\Desktop\data.xlsx";

2     Workbook workbook = Workbook.Load(file);
3     Worksheet worksheet = workbook.Worksheets[0];
4     worksheet.Cells[2, 3] = new Cell(textBoxText.Lines[0].ToString());
5     worksheet.Cells[2, 4] = new Cell(textBoxText.Lines[1].ToString());
6     workbook.Worksheets.Add(worksheet);
7     workbook.Save(file);
Taylor Swift
  • 242
  • 2
  • 17

0 Answers0