Free Support Forum - aspose.com

Using Excel 2007

Hi,

I am getting following exception while using Excel 2007 workbook.

I am using ASPOSE.CELLS 1.9.4

java.lang.IllegalStateException: This is not a structured storage file.

at com.aspose.cells.ds.(Unknown Source)

at com.aspose.cells.av.b(Unknown Source)

at com.aspose.cells.av.(Unknown Source)

at com.aspose.cells.Workbook.a(Unknown Source)

at com.aspose.cells.Workbook.open(Unknown Source)

Waiting for quick response.

Thank You.
Kailas

Hi,

Please make sure your template is xlsx format file and you have specified FileFormatType.EXCEL2007 when invoke open() method. If the issue persists, please give us the template file, we will check it soon

Hi Jhonson,

Thank you for you quick response. Specifying the file format type resolved the issue.
But now I am getting Nullpointerexception in following code part

// get the template worksheet for the leaf node provided.
Worksheet templateWorksheet = templateWorkbook.getWorksheets().getSheet(leafNode.getTabType());

// add a new worksheet in the target workbook.
Worksheet targetWorksheet = targetWorkbook.getWorksheets().addSheet();

// copy the contents of template worksheet to added worksheet.
targetWorksheet.copy(templateWorksheet);

// change the name of added worksheet.
targetWorksheet.setName(leafNode.getShortTabName());

ExcelDebugUtil.logExcel(targetWorksheet.getWorkbook(),"c:/targetWorksheet.xlsx",FileFormatType.EXCEL2007);

// get all the named ranges from the worksheet.
NamedRange[] namedRanges = targetWorksheet.getNamedRanges();

I am getting namedRanges as null, in the saved targetWorksheet.xlsx I am not getting named range which is there in templateworksheet.

Please help.

Thank You.
Kailas

Hi Kailas,

Could you post your template xlsx file, we will check it soon.

Thank you.

Hi Amjad,

I have attached the sample xlsx file.

Thank You.
Kailas

Hi,

Thanks for the template file.

I tested your template xlsx file and implemented you scenario. It works fine, I could not reproduce the issue you have mentioned. Which version of Aspose.Cells for Java you are using. Kinldy try the latest fix (1.9.4.10) attached @ the thread: http://www.aspose.com/community/forums/thread/122127.aspx and let us know if it works fine.

Thank you.

Hi Amjad,

Using this version resolved the issue.

Thank You for your kind support.

Regards
Kailas