|
hi,
i want to know how to access some part of data in excel sheet and copy to text file using pure c++.....please send me a code if u know this.....
|
|
|
|
|
I have code that do that, but is in MFC, is good for you ?
|
|
|
|
|
Here at CodeProject we have an article on such topic: "Accessing Excel Spreadsheets via C++"[^]. It uses ATL and COM , I don't know if you include those libraries into the 'pure C++ world'.
Veni, vidi, vici.
|
|
|
|
|
You may use different methods to read Excel files. Which one to use depends on the version of the Excel files (XLS and/or XLSX) and if Excel is installed or not:
- Using
Excel Automation (COM / OLE Dispatch) with the Excel type library. This requires an installed Excel on the machine running your application (which defines what Excel file versions can be read) and the Excel type library on the development machine. - Using
ODBC or ADO (OLE DB ). These are database interfaces that handle sheets from Excel files like databases tables. Drivers for XLS files are present on all Windows systems. Drivers for XLSX files are installed by Office 2007 or with the 'Microsoft Access Database Engine 2010 Redistributable' package. - Using a library. Examples are the ExcelFormat Library[^] here at CodeProject and the commercial LibXL[^] library.
Once you have decided which method you want to use, search for samples here at CP and in the web using the above keywords. But be prepared that reading Excel files is not done with a few lines of codes.
|
|
|
|