title: How to set Excel footer with Excel-Add-In
body: <p>I've been told to write up an Excel-Add-In which pastes a specific footer into every worksheet in a workbook.</p>
  
  <p>After reading up the documentation of the Excel.Interop namespace I ended up with this junky piece of code:</p>
  
  <pre><code> public partial class Ribbon1
  {
      Excel.Application _excelApp;
      private void Ribbon1_Load(object sender, RibbonUIEventArgs e)
      {
          _excelApp = new Excel.Application();
      }
  
      private void button1_Click(object sender, RibbonControlEventArgs e)
      {
          var filename = _excelApp.GetSaveAsFilename();
          Excel._Worksheet worksheet = (Excel._Worksheet)_excelApp.ActiveSheet;
          worksheet.PageSetup.CenterFooter = filename;
      }
  }
  </code></pre>
  
  <p>I have a problem in pinning the active worksheet. How can I actually use this object? - Right now it is null. I find the msdn articles related to this topic just plain stupid.</p>