We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Content type root element error


I am getting content type root element error when I try to import attached excel file and attached is sample code

Also it throws error where it try to go to read data function and go to ReadData function and open filestream.

Workbook workbook = new Workbook(_fileStream);

Excel file I am tyring to import has one hidden column in begning and last column named import data has merge header. since I am importing and creating datatable I already wrote logic to unmerge header and then rename blank column so it does not give column name cannot be blank issue.

But I am getting root content element type error


Thanks for your posting and using Aspose.Cells.

Please download and try the latest version: Aspose.Cells
for .NET v8.1.2.4
and see if resolves your issue.

We are unable to run your sample code because it gives some compile time errors and we cannot make it runnable. It will helpful if you could provide us some simple runnable console application project replicating this issue at our end.

We will look into it and update you asap.


Sent you sample console code.

can you try to import attached excel file.

it gives error while trying to read data.

saying that content type root element error.

excel file has hidden col in it.


Thanks for your sample project and using Aspose.Cells.

I have run your project with the latest version: Aspose.Cells
for .NET v8.1.2.4
and it generated the output file successfully without giving any exception.

I have attached the output xlsx file generated by your sample project and the sample project with a reference to latest version with this post. Please download it and run at your end.