#include "Libexcel.h"
#include <iostream>
#include <conio.h>

using namespace std;
using namespace Libexcel;

int main(int argc, char* argv[])
{
	try {

		Workbook* xls = new Workbook("example.xls");

		Worksheet* sheet = xls->addWorksheet(L"Simple");

		sheet->write(0, 0, L"Welcome!");
		sheet->write(L"A3", 65.0083);
		sheet->write(L"A4", 21.0024);
		sheet->write(L"A5", 10.0015);
		
		Format* format = xls->addFormat();
		format->setBold();
		format->setTextColor(Format::COLOR_RED);
		sheet->write(L"A6", L"=A3+A4+A5", format);

		sheet->write(7, 0, L"http://libexcel.com");
	
		xls->close();
		delete xls;

	} catch(const Error& e) {		
		std::wcout << e.message() << std::endl;		
	}

	cout << "press any key to exit..." << endl; _getch();
	return 0;
}
