Writing to xlsx files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wolfjmt
    New Member
    • Jan 2009
    • 10

    Writing to xlsx files

    Hi, I am trying to write to data to a .xlsx file(Excel 2007). I can currently write the data to a .xls file. I tried to change the extension of the xls file (to xlsx) but Excel gave the following error:Excel cannot open the file 'Filename.xlsx' because the file format or file extent ion is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file.
    I know Excel(2007) can open the xls file but I would like to save the data directly to a xlsx file.
    Is it possible?, if not is there a way to automatically convert the file from the xls format to the xlsx format?
    Any advice would be greatly appreciated
    Thanks in advance
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    XLS and XSLX are two different file formats. you have to convert xls to xlsx to open the latter correctly. you can use for that Microsoft's own converter or get the appropriate OpenXML Doc for spreadsheets and rewrite your xls converter.

    regards

    Comment

    • wolfjmt
      New Member
      • Jan 2009
      • 10

      #3
      OK I do it that way
      Thank for the quick reply and help

      Comment

      • skitsanos
        New Member
        • Jan 2009
        • 3

        #4
        XSLX is just a Zip archive, you can open it programmaticaly with any library available for you, inside of it you willfind your XML source with data. To understand this format in depth just rename .xlsx extension into .zip and extract content on disk and just go through files you will see there. This will help you a lot. This valid for all Microsoft Office 2007 file formats.

        Comment

        Working...