5
Contributors
5
Replies
15
Views
8 Years
Discussion Span
Last Post by Prakash.sit
0

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.

0

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

0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.