title: Python Dataframe to existing Excel sheet overwriting data
body: <p>Starting from this question:</p>
  <p><a href="https://stackoverflow.com/questions/54713665/output-to-excel-file-without-overwriting-sheets">Output to excel file without overwriting sheets</a></p>
  <p>I would like to <strong>overwrite existing data in Excel</strong>, but only starting on a certain row and column, <strong>leaving there rest of the sheet intact</strong>.</p>
  <p><a href="https://i.stack.imgur.com/TcRDg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TcRDg.png" alt="enter image description here" /></a></p>
  <p>The Excel above would then turn into something like:</p>
  <p><a href="https://i.stack.imgur.com/g8d0C.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g8d0C.png" alt="enter image description here" /></a></p>
  <p>The code from the answer that is correct, on the linked question is this:</p>
  <pre><code>import pandas as pd
  
  # Initialize xlsx writer and open existing file
  
  writer = pd.ExcelWriter('output_file.xlsx', engine='xlsxwriter')
  workbook = writer.book
  
  df = pd.DataFrame({&quot;a&quot;: [1,2,3],
                      &quot;b&quot;: [1,2,3]})
  
  #The objective here is just to paste the dataframe on an existing Excel sheet
  #and overwrite what is there, leaving unchanged the rest of the sheet.
  
  df.to_excel(writer,
               sheet_name=&quot;Data&quot;,
               startrow=3,
               startcol=3)
  
  
  
  writer.save()
  </code></pre>
  <p>I have the file &quot;output_file&quot; with 4 sheets and a lot of other data.</p>
  <p>This code is overwriting the file with a new file. I would just like to add the dataframe to the spreadsheet &quot;Data&quot;, starting on the specified row and column and leaving the rest of the &quot;Data&quot; spreadsheet untouched.</p>
  <p>Thank you all.</p>