title: xlsx writing cell_value error, writing to new worksheet
body: <p>I'm trying to build a report generator which reads excel sheets and returns rows which contain values. I built a version which works as I require but only works for csv this is only my 1st code-mash-together, but it worked. I now would like to include conditional formatting as well (highlight certain cells values eg. if &lt;65 format red) and so that required that I rewrite with xlsx sheets rather than csv.
  Below is my attempt at getting this to work...
  I can find the values and return the row, but on the second run through it returns an error</p>
  
  <blockquote>
    <p>AttributeError: 'Worksheet' object has no attribute 'cell_value'</p>
  </blockquote>
  
  <p>Which is surprising because it worked just previously and stepping through the code retuns the values I want.... I have tried changing it to .value, but returns:</p>
  
  <blockquote>
    <p>AttributeError: 'function' object has no attribute 'value'</p>
  </blockquote>
  
  <p>Help, I have no idea what I'm doing now. If it doens't make any sense i'm happy to post my original code for the csv to 'explain'</p>
  
  <p>Thanks</p>
  
  <pre><code>import xlsxwriter
  import xlrd
  import os
  import xlwt
  
  # open original excelbook and access first sheet
  for excelDocs in os.listdir('.'):
      if not excelDocs.endswith('.xlsx'):
          continue    # skip non-xlsx files
  
      workbook = xlrd.open_workbook(excelDocs)
      sheet = workbook.sheet_by_index(0)
      cellslist = []
      i = 0
  #########WORKS!#####################
      for row in range(sheet.nrows):
          for col in range(sheet.ncols):
  
              if sheet.cell_value(row, col) == 'CP' or sheet.cell_value(row, col) == 'LNA' or sheet.cell_value(row, col) == 'Last Name':
                  i = i + 1
                  data = [sheet.cell_value(0, col) for col in range(sheet.ncols)]
                  workbook = xlsxwriter.Workbook()
                  sheet = workbook.add_worksheet('excelDocs')
  
                  for index, value in enumerate(data):
                      sheet.write(i, index, value)
                  workbook = xlrd.open_workbook(excelDocs)
  </code></pre>