I am trying to convert html table to excel.
string contents = "<html><body><h1>hello</h1></body></html>";
byte[] byteArray = Encoding.UTF8.GetBytes(contents);
MemoryStream stream = new MemoryStream(byteArray);
Workbook workbook = new Workbook();
workbook.LoadFromStream(stream);
//AutoFit rows
Worksheet sheet = workbook.Worksheets[0];
sheet.AllocatedRange.AutoFitRows();
//Save the document to file
workbook.SaveToFile("Result.xlsx", FileFormat.Version2010);[/list][/list]
The code " workbook.LoadFromStream(stream);" throws this exception. 'Zip exception.Can't locate end of central directory record. Possible wrong file format or archive is corrupt.'
Please help.