Reputation: 4540
this is my first time using ExcelLibrary and I seem to have run into a little problem. I am saving a test file using the following code:
Workbook workbook = new Workbook();
Worksheet worksheet = new Worksheet("Sheet 1");
//Write the first row
worksheet.Cells[0, 0] = new Cell("Name");
worksheet.Cells[0, 1] = new Cell("Address");
worksheet.Cells[0, 2] = new Cell("Phone");
worksheet.Cells[0, 3] = new Cell("Fax");
worksheet.Cells[0, 4] = new Cell("E-mail");
worksheet.Cells[0, 5] = new Cell("Contact Person/s");
worksheet.Cells[0, 6] = new Cell("Domain/s of Activity");
worksheet.Cells[0, 7] = new Cell("Number of Employees");
worksheet.Cells[0, 8] = new Cell("Turnover");
workbook.Worksheets.Add(worksheet);
workbook.Save(sfd.FileName);
But when I try to open the file, I get a warning box saying it is unreadable. I am opening the file in Excel 2010 and just as a side note, I can open other .xls files just not the ones generated by the program.
What am I doing wrong?
Thanks.
Upvotes: 2
Views: 1106