title: Extract Data LibXL C++
body: <p>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:</p>
  
  <pre><code>Book* book = xlCreateBook();
  if(book)
  {
      if(book-&gt;load(L"example.xls"))
      {
          Sheet* sheet = book-&gt;getSheet(0);
          if(sheet)
          {
              const wchar_t* s = sheet-&gt;readStr(2, 1);
              if(s) wcout &lt;&lt; s &lt;&lt; endl;
  
              double d = sheet-&gt;readNum(3, 1);
              cout &lt;&lt; d &lt;&lt; endl;
          }
      }
  
      book-&gt;release();
  }
  </code></pre>
  
  <p>Here is the block of code from my C++ program where I want to link certain excel cells to variables in C++:</p>
  
  <pre><code>{var1 = .0887; var2 = .175; var3 = .299; var4 = .292; var5 = .151; var6 = .051; var7 = .001; var8 = .02;}
  </code></pre>
  
  <p>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. </p>