title: Deleting Sheet from workbook - python
body: <p>I want to delete a sheet from my Excel file and i am trying this code:</p>
  <pre class="lang-py prettyprint-override"><code>
  import openpyxl
  
  workbook1 = openpyxl.load_workbook(input_file_folder + input_file_name)
  print(workbook1.sheetnames)
  Sheet1 = workbook1['Sheet1']
  workbook1.remove(Sheet1)
  workbook1.save(input_file_folder + input_file_name)
  writer.save()
  
  </code></pre>
  <p>The sheet names are printing out to be:
  <code>['Sheet1', 'Candidate Campaign 0', 'Candidate Campaign 6', 'Candidate Campaign 7', 'Candidate Campaign 8', 'Valid Campaigns']</code></p>
  <p>But somehow the &quot;Sheet1' is not getting deleted anyhow.</p>
  <p>I even tried:</p>
  <pre class="lang-py prettyprint-override"><code>
  n = workbook1.sheetnames
  workbook1.remove(n[1])
  
  </code></pre>
  <p>but this doesnt work as well.</p>
  <p>Can anyone please pinpoint what's wrong. As this command is working with other sheets but only <code>Sheet1</code>(the default one) is not getting deleted.</p>