0

hi i'm currently making a program relating to money and i need my c++ to read one of my excel files which has all the prices etc in it

how do i make it work? =/

6
Contributors
5
Replies
7
Views
7 Years
Discussion Span
Last Post by gabryprof
0

It's very hard to read an excel file, but you could try reading an Excel XML file.

0

Save the Excel file out as a CSV file and read it in like any other text file (with ifstream, etc.).

Edited by jonsca: n/a

0

try this library - http://www.libxl.com

hi i'm currently making a program relating to money and i need my c++ to read one of my excel files which has all the prices etc in it

-2
#include "stdafx.h"
#include <fstream>
#include <iostream>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{	
	char continue = 'N';
	fstream fileExcel;
	fileExcel.open("myfile.xls", ios::in);
	do{	
		char strLine[100];
		fileExcel.getline(strLine,99);
		cout << strLine;
		cout <<"\nType N if you want to stop\n";
		cin >> continue;		
	}while (continue != 'N');
	system("PAUSE");
	return 0;
}
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.