locked
XLSX Excel File can be opened in Excel 2007 but not supported by Open XML SDK 2.0 Productivity Tool RRS feed

  • Question

  • Hello,

    I can open a xlsx File created by an application with Microsoft Office Excel 2007. But I can't open it with the Open XML SDK 2.0 Productivity Tool. The error message is : "Cannot open the file : The specified file type is not supported".

    When I try to load the file in C# as that :

    SpreadsheetDocument excelDocument = SpreadsheetDocument.Open(filefullName, false);

    I get an OpenXMLPackageException with this error message : The specified package is invalid. The main part is missing.

    I can unzip the Excel file so it is a open XML format file.

    If the main part is missing, why Excel 2007 can succeed to open it ?

    I can send you the file if you need.

    Thank uou for your help.

    Friday, March 25, 2011 7:48 PM

Answers

  • Hi ShadoFil,

    Thank you for posting.

    I have ever encountered such error message before. I think there is something wrong with the xlsx file. Though you can open it in Excel 2007, did you also encounter errors? It seems that the application didn't create the xlsx file correctly. So, could you show the code snippet?

    >>If the main part is missing, why Excel 2007 can succeed to open it ?
    Though there is something wrong with the Excel file, the Excel application can ignore the error and try to repair it and sometimes it can be successfully opened.

    I hope this can help you and feel free to follow up.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Bruce Song Friday, April 8, 2011 11:41 AM
    Monday, March 28, 2011 2:32 AM
  • I agree with Bruce - Excel could choose to ignore some errors, but we'd need to see the file - or, at the very least, the structure of the package - to be able to say more.
     

    Enjoy,
    Tony
    www.WordArticles.com
    • Marked as answer by Bruce Song Friday, April 8, 2011 11:41 AM
    Monday, March 28, 2011 5:38 AM

All replies

  • Hi ShadoFil,

    Thank you for posting.

    I have ever encountered such error message before. I think there is something wrong with the xlsx file. Though you can open it in Excel 2007, did you also encounter errors? It seems that the application didn't create the xlsx file correctly. So, could you show the code snippet?

    >>If the main part is missing, why Excel 2007 can succeed to open it ?
    Though there is something wrong with the Excel file, the Excel application can ignore the error and try to repair it and sometimes it can be successfully opened.

    I hope this can help you and feel free to follow up.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Bruce Song Friday, April 8, 2011 11:41 AM
    Monday, March 28, 2011 2:32 AM
  • I agree with Bruce - Excel could choose to ignore some errors, but we'd need to see the file - or, at the very least, the structure of the package - to be able to say more.
     

    Enjoy,
    Tony
    www.WordArticles.com
    • Marked as answer by Bruce Song Friday, April 8, 2011 11:41 AM
    Monday, March 28, 2011 5:38 AM
  • Hi ShadoFil,

    Have you figured out your problem yet, and do the suggestion help you or not? If you still have any concern on the problem, just feel free to follow up. We are happy to help with you.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, March 30, 2011 10:49 AM
  • Hello,

    Thank you for your help. I sent you the xlsx file on your "Feedback to us" address.

    Best regards,

    Sunday, April 10, 2011 9:39 PM
  • Hi ShadoFil,

    Could you send the file to the skydrive and share the link with us? Or send it to my email: BruceSong2010@hotmail.com

    I will have a look at your Excel file.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, April 13, 2011 1:54 AM
  • Hi Bruce, I'm getting the same issue here with excel file and was hoping to see an update/reason for this.  My excel file has a little sensitive info so I can't send it to people but I can send you the screen capture for the different levels/folders of the excel file when saved as .zip file.  Please let me know if this will help you troubleshoot.

    In general, when we get this message, what is main part part or what file it is looking for?  Thanks.

    Wednesday, February 15, 2012 11:42 PM