Dot not support export a wbook without normal worksheet to excel 2007 format

I am using v7.0.1 and intermittently getting this error when saving a workbook.


System.Web.HttpUnhandledException (0x80004005): Exception of type ‘System.Web.HttpUnhandledException’ was thrown. —> Aspose.Cells.CellsException: Dot not support export a wbook without normal worksheet to excel 2007 format
at Aspose.Cells.Workbook.Save(String fileName, SaveOptions saveOptions)

I found out that my query was returning no DataSet and I had previously deleted the worksheet. Therefor, I was not creating or writing a new worksheet.

You can not save a workbook without a worksheet.

Hi,

I was able to reproduce this exception using the following code and I found, it is a correct behavior.

C#


string filePath = @“F:\Shak-Data-RW\Downloads\output.xlsx”;


Workbook workbook = new Workbook();


workbook.Worksheets.RemoveAt(0);


workbook.Save(filePath);