title: Unable to overwrite existing excel sheet with openpyxl
body: <p>I'm trying to format excel sheets using if else condition but unable to rewrite the file. Code is written below.</p>
  <pre><code>from openpyxl import load_workbook
  
  sheet_name = &quot;C:\\python\\book.xlsx&quot;
  wb = load_workbook(sheet_name)
  sheet = wb['Data1']
  
  for row in range(1, sheet.max_row+1):
      print(row)
      value1 = sheet.cell(row, 1).value
      if &quot;st1&quot; in value1:
          value1 = &quot;Invite&quot;
      elif &quot;st2&quot; in value1:
          value1 = &quot;Closed&quot;  
      elif &quot;st3&quot; in value1:
          value1 = &quot;Pending&quot;  
      print(value1)
      wb.save(sheet_name)
  </code></pre>
  <p>Output</p>
  <pre><code>Closed
  Invite
  Closed
  Pending
  </code></pre>
  <p>It does print the output which I wanted but it doesn't rewrite the excel file. File remains unchanged. How can save the file after making all the correction?</p>