Here's your problem:
fp.close
You need to call the close
method, not just reference it as a method. So:
fp.close()
However, it will make your life easier if you use with
statements instead of trying to figure out where to explicitly close
everything:
with open(os.path.join(filePath, filename), 'wb') as fp:
wr = csv.writer(fp, quoting=csv.QUOTE_ALL)
for rownum in xrange(sheet.nrows):
wr.writerow(sheet.row_values(rownum))