kindly let me know how to open an excel file in c++

Since you didn't really specify....

#include <fstream>

using namespace std;

int main(int argc, char **argv)
{
     fstream fin;
     std::string excel_file = "c:\myfile.xls";
     fin.open(excel_file.c_str(), ios::in);

     if (fin.is_open()) {
          // excel file is opened
          fin.close();
     } else {
         cout << "Failed To Open File" << endl;
     }
}

Although, I bet you are really looking for this here.

Thank you so much for your quick reply. Can you please let me know how to read data from and write data to the excel file

Well Xls files are written in BIFF format. therefore i think that we should read them in hexadecimal and then convert them into ASCII.

If it is possible for you to edit the excel file i think you should store it into ".csv" extention.

CSV stands for Comma Separated Values and would be easier to read from.

plese help the how to read the excel data using pure c++ code

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.