PDA

View Full Version : read and write data in excel files



robotics
3rd June 2011, 02:36
Please anyone sugggest me how to read and write data in microsoft excel files...
every help shall be appreciated

ChrisW67
3rd June 2011, 05:27
You can use ActiveX (QAxObject and friends) to control an Excel object. If you just want to read or write an XLS file as if it were a table then you can actually do that through an Excel ODBC driver and hence the QODBC database driver (adapt the DSN from http://www.codeproject.com/KB/database/excel_odbc_write.aspx)

pkj
5th June 2011, 12:54
QAxContainer is not under LGPL but only under commercial license. Besides you will have to use interface of excel which I think is messy. I used a C++ commercial library called libxl. It is good. If commercial is not an option u can try VOLE too. And if you are successful with it, please write a blog about how you managed with VOLE:)

ChrisW67
6th June 2011, 00:13
You are bit out of date there. QAxContainer and QAxServer are released under a BSD licence (since 4.5 IIRC). From the 4.7 docs:

The QAxContainer module is not covered by the GNU General Public License (GPL), the GNU Lesser General Public License (LGPL), or the Qt Commercial License. Instead, it is distributed under the following license.
Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
All rights reserved.
Contact: Nokia Corporation (qt-info@nokia.com)
You may use this file under the terms of the BSD license as follows:
...