title: Insert_textbox in a worksheet in the same workbook as a chartsheet
body: <p>Using Python 3.5 and xlsxwriter 0.9.6.</p>
  
  <p>I'm having a problem inserting a textbox in a worksheet, when there is also a chartsheet in the same workbook.</p>
  
  <p>Below I've used an example from the xlsxwriter documentation (<a href="http://xlsxwriter.readthedocs.io/example_chart_data_table.html" rel="nofollow noreferrer">http://xlsxwriter.readthedocs.io/example_chart_data_table.html</a>) and added in a textbox to the worksheet portion.  </p>
  
  <pre><code># Copyright 2013-2016, John McNamara, jmcnamara@cpan.org
  #
  import xlsxwriter
  
  workbook = xlsxwriter.Workbook('chartsheet.xlsx')
  
  # Add a worksheet to hold the data.
  worksheet = workbook.add_worksheet()
  
  # Add a chartsheet. A worksheet that only holds a chart.
  chartsheet = workbook.add_chartsheet()
  
  # Add a format for the headings.
  bold = workbook.add_format({'bold': 1})
  
  # Add the worksheet data that the charts will refer to.
  headings = ['Number', 'Batch 1', 'Batch 2']
  data = [
  [2, 3, 4, 5, 6, 7],
  [10, 40, 50, 20, 10, 50],
  [30, 60, 70, 50, 40, 30],
  ]
  
  worksheet.write_row('A1', headings, bold)
  worksheet.write_column('A2', data[0])
  worksheet.write_column('B2', data[1])
  worksheet.write_column('C2', data[2])
  
  #Section I've added in
  tb_options = {
  'width': 10,
  'height': 10,
  'x_offset': 5,
  'y_offset': 5,
  'fill': {'color': 'gray'}}
  worksheet.insert_textbox('A15', " ", tb_options)
  #End of Section I've added in
  
  # Create a new bar chart.
  chart1 = workbook.add_chart({'type': 'bar'})
  
  # Configure the first series.
  chart1.add_series({
  'name':       '=Sheet1!$B$1',
  'categories': '=Sheet1!$A$2:$A$7',
  'values':     '=Sheet1!$B$2:$B$7',
  })
  
  # Configure a second series. Use of alternative syntax define ranges.
  chart1.add_series({
  'name':       ['Sheet1', 0, 2],
  'categories': ['Sheet1', 1, 0, 6, 0],
  'values':     ['Sheet1', 1, 2, 6, 2],
  })
  
  # Add a chart title and some axis labels.
  chart1.set_title ({'name': 'Results of sample analysis'})
  chart1.set_x_axis({'name': 'Test number'})
  chart1.set_y_axis({'name': 'Sample length (mm)'})
  
  # Set an Excel chart style.
  chart1.set_style(11)
  
  # Add the chart to the chartsheet.
  chartsheet.set_chart(chart1)
  
  workbook.close()
  </code></pre>
  
  <p>The error generated by excel says:
  "We found a problem with some content in 'chartsheet.xlsx'.Do you want us to try to recover as much as we can? If you trust the source of this workbook, Click Yes."</p>
  
  <p>I'd like to avoid having this error if possible. If I omit the chartsheet from the code and just the worksheet is produced then the text_box is added without problems.</p>
  
  <p>Does anybody know of a solution, where you can have a worksheet with a textbox inside in addition to a chartsheet in the same workbook?   </p>