title: Xlsxwriter in pandas and outside of pandas lockout
body: <p>I am using <strong>xlsxwriter</strong> engine to push some dataframes into excel sheet with <strong>pandas.to_excel()</strong>, but I need a caption above each table. </p>
  
  <p>Here is an example of what result I would like to achieve:
  <a href="https://i.stack.imgur.com/QXj5F.png" rel="noreferrer"><img src="https://i.stack.imgur.com/QXj5F.png" alt="enter image description here"></a></p>
  
  <p>I did not see any way to use ExcelWriter object of pandas to simply manipulate content of each cell and when I try to do it, I get:</p>
  
  <blockquote>
    <p>Exception: Sheetname 'sample', with case ignored, is already in use.</p>
  </blockquote>
  
  <p>I guess xlsxwriter locks it for itself. Here is an example: </p>
  
  <pre><code>xlsx_writer = pd.ExcelWriter(
      get_target_filepath(xlsx_name),
      engine='xlsxwriter'
  )
  
  workbook = xlsx_writer.book
  worksheet = workbook.add_worksheet(sheet_name)
  
  worksheet.write(1, 1, 'ABC')
  
  _, sample_table = dataframe_tuples[0]
  sample_table.to_excel(xlsx_writer, startrow=3, startcol=2, sheet_name=sheet_name)
  </code></pre>
  
  <p>I could save dataframes and go over it again with openpyxl, but I seriously dislike the way they do formatting, which I have to do next, and if I format it in xlsxwriter and then reopen it with openpyxl, it cannot save the formatting back properly, openpyxl ruins it. </p>
  
  <p>I can not put excel itself onto server to use VBA macros for styling.</p>
  
  <p>Is there any way around this or am I just doing something horribly wrong? </p>