none
Unable To Open xlsm file in OpenXML SDK 2.0

    Question

  • I'm having a problem opening xlsm files. If I try to open the file with Open XML I get a "File is Corrupted" error. However if I or someone else opens the file in Excel and then saves it (not making any changes), it opens just fine with Open XML. I need some suggestions on what is going on.
    Wednesday, February 13, 2013 10:02 PM

Answers

  • Hi Whalensdad,

    It's based on my experience that you has some extension which will add additional xml content into your spreadsheet document and that might can't recognize via Open Xml SDK. I think a unclosed xml content might exist in the document. And resave action will fix it.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, February 15, 2013 5:15 AM
    Moderator

All replies

  • Hi Whalensdad,

    Thanks for posting in the MSDN Forum.

    It seems that your xlsm has error in it. Would you please tell me where this xlsm comes from?

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, February 14, 2013 2:38 AM
    Moderator
  • We created a template XLSM file that was distributed to about 50 different people. Each person poulates this template each month and sends it back to us. We have an SSIS task that loads the template into the database. Previuosly we were using the interop from our desktop in the SSIS task, but we anted to shift to Open XML so it could be run from a server. These files have been in use for well over a year and they open just fine, without any errors in Excel. The "File Contains Corrupt Data" is occuring on EVERY file unless I open and resave the file.

    I also had someone else open the file and then resave it. The file load indicates the data is corrupted. It ONLY seems to work if I open and save the file.


    • Edited by Whalensdad Thursday, February 14, 2013 4:15 PM
    Thursday, February 14, 2013 1:27 PM
  • Hi Whalensdad,

    It's based on my experience that you has some extension which will add additional xml content into your spreadsheet document and that might can't recognize via Open Xml SDK. I think a unclosed xml content might exist in the document. And resave action will fix it.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, February 15, 2013 5:15 AM
    Moderator
  • I got the same issue with .xlsm files the only solutiont that i find, is to delete macros and save the document as xlsx...if someone got the solution, please share it.
    • Edited by Amine Sassi Tuesday, February 11, 2014 2:49 PM
    Tuesday, February 11, 2014 2:49 PM
  • I have found that the only time it occurs is if there are passwords. If there are no passwords I have no issues opening xlsm files.
    Tuesday, February 11, 2014 2:54 PM