Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Read Excel attachment - Error

$
0
0

Hi,

I'm usining Dynamics CRM 365 online and I need to read an Excel file attached, but I receive this message:"System.IO.FileFormatException: 'File contains corrupted data.'" 

This is the code:

string documentBody = data.ReadExcelFile(id);
byte[] byteArray = Encoding.UTF8.GetBytes(documentBody);

Stream stream = new MemoryStream(byteArray);

using (SpreadsheetDocument spreadsheetDocument = SpreadsheetDocument.Open(stream, false)) <-- ERROR LINE
{
   WorkbookPart workbookPart = spreadsheetDocument.WorkbookPart;


someone had the same problem? 

thanks in advance

Horacio 


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images