title: How to set active header/footer type in existing Excel sheet with openpyxl in Python?
body: <p>I have a large number of Excel sheets that I want to iterate through and update the first-page footer and set the worksheet to "Different first page"  on them using openpyxl. The following code works to open the excel file, alter the first-page footer but I cannot find in the docs how to change which footer is the active one for printing. Is this even possible?</p>
  
  <p><a href="https://openpyxl.readthedocs.io/en/stable/api/openpyxl.worksheet.header_footer.html" rel="nofollow noreferrer">https://openpyxl.readthedocs.io/en/stable/api/openpyxl.worksheet.header_footer.html</a></p>
  
  <pre><code>from openpyxl import load_workbook
  from openpyxl.utils import get_column_letter
  
  filename = '150913M2_IS.xlsm'
  
  wb = load_workbook(filename, read_only=False, keep_vba=True)
  
  ws = wb.active
  
  #Attempted setting this value to True but this does nothing
  ws.differentFirst = True
  
  #This works perfectly to set the first page footer
  #but I have to manually go in and change the Excel sheet 
  #to 'Different first page'
  ws.firstFooter.left.text = 'Hello World'
  
  wb.save(filename)
  </code></pre>