I downloaded LibXL to help modify a C++ program I've created. I have a bunch of global variables in my C++ file that I'd like to link to values in an excel spreadsheet. Can someone please explain how I'd do this if the excel sheet I'm linking to is called "Sheet 1" and the Workbook is called "Book 1". This is the code sample on the LibXL site for extracting data from an excel spreadsheet:
Book* book = xlCreateBook();
if(book)
{
if(book->load(L"example.xls"))
{
Sheet* sheet = book->getSheet(0);
if(sheet)
{
const wchar_t* s = sheet->readStr(2, 1);
if(s) wcout << s << endl;
double d = sheet->readNum(3, 1);
cout << d << endl;
}
}
book->release();
}
Here is the block of code from my C++ program where I want to link certain excel cells to variables in C++:
{var1 = .0887; var2 = .175; var3 = .299; var4 = .292; var5 = .151; var6 = .051; var7 = .001; var8 = .02;}
My code that needs to be edited just features various variable names. I would want those variables/values to be linked to or equal to variables in an excel spreadsheet with the above name and book. I really wasn't sure how to implement this sample code I've shown, partially bc I did not understand the above sample.