471,592 Members | 1,201 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,592 software developers and data experts.

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
Jan 7 '09 #1
3 13002
8,656 Expert Mod 8TB
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.

Jan 7 '09 #2
OK I do it that way
Thank for the quick reply and help
Jan 7 '09 #3
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.
Jan 9 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by SomeDude | last post: by
2 posts views Thread by George Marsaglia | last post: by
6 posts views Thread by guy | last post: by
24 posts views Thread by ypjofficial | last post: by
35 posts views Thread by rbt | last post: by
2 posts views Thread by ShihChun | last post: by
1 post views Thread by Michael Leithold, WWK | last post: by
1 post views Thread by Doogie | last post: by
5 posts views Thread by wolfjmt | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.