title: How to access data in sheet in my Visual Studio Office Excel workbook?
body: <p><em>I need to create a "Document level customization" with C# code (not and Excel Add-in!)</em> </p>
  
  <p>I created a Visual Studio Office Excel 2010 Workbook project type. This creates a workbook with 3 sheets in my project. I added some "configuration" information to one of those sheets.</p>
  
  <p>I need to access this <strong>configuration</strong> information programmatically (<code>Sheet1</code> contains a <code>button</code> - pressing on that button should</p>
  
  <ol>
  <li>load <strong>configuration</strong> data  </li>
  <li>open a WinForm</li>
  <li>present configuration data on that form,</li>
  </ol>
  
  <p>but somehow I can't find how to do that...</p>
  
  <p>If I try to initialize <code>Sheet1</code> class, compiler expects two parameters - <code>Microsoft.Office.Tools.Excel.Factory</code> and <code>IServiceProvider</code>, but I am calling this from a button that is placed on Sheet2 - so it's <strong>after</strong> Excel Workbook is already opened... shouldn't Sheet1 be initialized automatically?</p>
  
  <p>So, how can I access <code>Sheet1</code> from my VSTO project's c# code?</p>
  
  <h2>EDIT</h2>
  
  <p><a href="http://screencast.com/t/l3tJgrFDkFkH" rel="nofollow">Please see project sample screencast here</a></p>
  
  <p>I have a button on Sheet2, that should </p>
  
  <ol>
  <li>load some data from Sheet1</li>
  <li>initialize WinForm</li>
  <li>add it as a DataSource for a ComboBox on that WinForm</li>
  </ol>
  
  <p>I can not find a way how to read data from that Sheet1...</p>