473,549 Members | 2,862 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Writing to xlsx files

10 New Member
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 13215
8,658 Recognized Expert Moderator Expert
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
10 New Member
OK I do it that way
Thank for the quick reply and help
Jan 7 '09 #3
3 New Member
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

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

Similar topics

by: SomeDude | last post by:
Hi, I have a question on file writing. I am not very experienced in Java programming. My hobby right now is to write an applet where 2 persons could play Go together (it is a board game). The offline interface is done but I was wondering how to send information between the two players. Since I am not very experienced in Java and I am just a...
by: George Marsaglia | last post by:
I have a set of, say, 2000 points in the 8-dimensional simplex S={(x_1,x_2,...,x_8),x_1+x_2+...+x_8=1, x's>=0}. To help analyze that 8-dimensional set, I wish to project the set of points onto each of the 'faces' {x_i+x_j+x_k=1} for the 56 choices i,j,k, that is, i=1 to 6; j=i+1 to 7; k=j+1 to 8. Finally, use gnuplot to load and plot each of...
by: guy | last post by:
Does .NET have a class or set of functions that facilitate the creating and writing of html files? I have been creating files in streams and constructing html strings and writing them out but it seems that a class could facilitate this better. Thanks
by: ypjofficial | last post by:
Hello all, I have written a class with many private data members.and i am putting it in a separate dll file. Now when i link that file while writing my main program module,natuarally i have to use the header file of the class developed by me to access its functionality. so what should be there in the header file? Only the public methods...
by: rbt | last post by:
I've been doing some file system benchmarking. In the process, I need to create a large file to copy around to various drives. I'm creating the file like this: fd = file('large_file.bin', 'wb') for x in xrange(409600000): fd.write('0') fd.close() This takes a few minutes to do. How can I speed up the process?
by: ShihChun | last post by:
Hi everyone, I encounter a problem in writing binary files for Sun Solaris system. The problem is I have an array (data type: double) need to be ported from PC to Sun Solaris workstation. However, the binary files produced by fwrite will cause Sun read in wrong data Does anybody know how to solve it? Thanks a lot
by: Michael Leithold, WWK | last post by:
Hello, is there a .NET library for writing log files? I'm looking for something to configure the log files. E.g. using date-/timestamps, deleting old log files, log file rotation for big log files, debug logging, error logging etc. Regards, Michael
by: Doogie | last post by:
Hi, I am writing a script to export data to an excel file which works fine but I've seen one thing that is confusing. If I use the extension .xlsx, the file will get created, but Excel won't let me open it (although I have the new version of Office in my machine and have opened other .xlsx files before). If I save it as .xls it saves/...
by: wolfjmt | last post by:
Hi, I am trying to write to data to a .xlsx file. 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...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.