title: How to set active sheet with Open XML SDK 2.5
body: <p>using the example here <a href="http://blogs.msdn.com/b/brian_jones/archive/2009/02/19/how-to-copy-a-worksheet-within-a-workbook.aspx" rel="noreferrer">How to Copy a Worksheet within a Workbook</a></p>
  
  <p>I have successfully been able to clone/copy sheets in my excel file, however when I open the excel the 2nd sheet is the active(visible) sheet. I haven't been able to locate a property that could do thins.....Is there any way to specify what sheet is active?   </p>
  
  <p>I've tried to force it by opening and editing the first sheet in the file thinking it was the last edited sheet that was active but that didn't work either. </p>
  
  <p>any help would be great. TIA</p>
  
  <p>update: looking at the workbook.xml created when renaming the .xlsx to .zip I came accross the 'activeTab' property.  made a quick change to my code and seems to work just fine</p>
  
  <pre><code>public void SetFirstSheetInFocus(String xlsxFile)
      {
          using (SpreadsheetDocument spreadSheet = SpreadsheetDocument.Open(xlsxFile, true))
          {
              //Get a reference to access the main Workbook part, which contains all references
              WorkbookPart _workbookPart = spreadSheet.WorkbookPart;
              if (_workbookPart != null)
              {
                  WorkbookView _workbookView = spreadSheet.WorkbookPart.Workbook.BookViews.ChildElements.First&lt;WorkbookView&gt;();
                  if (_workbookView != null)
                  {
                      _workbookView.ActiveTab = 0; // 0 for first or whatever tab you want to use
                  }      
                  // Save the workbook.
                  _workbookPart.Workbook.Save();
              }
  
          }
      }
  </code></pre>