Not Able to read Excel2007 Byte[] array

My code is like this

Iam Passing bytArrFileData to this method which is coming from Excel2007 .

Issue is Importingl Excel to grid.

when i import Excel2003 then its converting to byte[] and reading by excel and working fine but

when i upload excel 2007 then its converting byte[] but not reading by Excel object

public FrameworkExcel(byte[] bytArrFileData)

{

Aspose.Cells.Workbook=objExcel;

try

{

objExcel.Open(new MemoryStream(bytArrFileData), AE.FileFormatType.Excel2007Xlsx);

}

catch

{

objExcel.Open(new MemoryStream(bytArrFileData), AE.FileFormatType.Default);

}

}

Please reply me as soon as possible,awaiting for ur reply

Hi,

Thank you for considering Aspose.

Well, I have tested your scenario and it works fine. Which version of Aspose.Cells are you using? Please try the attached latest version. If you still face any problem, please post your template file and we will check it soon. Following is my sample code and attached are my input and output files.

Sample Code:

//Get an excel file path in a variable.

string path = @"e:\excels\book1.xlsx";

//Get the picture into the streams.

FileStream fs = File.OpenRead(path);

//Define an array of bytes.

byte[] objectData = new Byte[fs.Length];

//Store the file from streams.

fs.Read(objectData, 0, objectData.Length);

//Close the stream.

fs.Close();

Aspose.Cells.Workbook objExcel = new Workbook();

objExcel.Open(new MemoryStream(objectData), FileFormatType.Excel2007Xlsx);

objExcel.Save("e:\\excels\\newTest.xlsx", FileFormatType.Excel2007Xlsx);

Thank You & Best Regards,