title: Lock some cells from editing in python openpyxl
body: <p>I'm using <a href="https://openpyxl.readthedocs.io/en/default/" rel="noreferrer"><code>openpyxl</code></a> to work with Microsoft Excel files (.xlsx/.xlsm), however I am struggling to lock cells (ie. prevent editing). My current code is this:</p>
  
  <pre><code>lock = Protection(locked=True,
                      hidden=False)
  ws['A1'].protection = lock  # ws is my worksheet
  </code></pre>
  
  <p>However, I am still able to edit cell <code>A1</code>. How can I fix it?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>This <a href="https://groups.google.com/forum/#!topic/openpyxl-users/a5tYaNc2WSk" rel="noreferrer">link</a> (to a <code>openpyxl</code> email chain) recommends locking the entire sheet and then to unlock all of the cells but for <code>A1</code>. However, this does not look like a reliable solution as I'll be dumping large amounts of data.</p>