Convert xlsm to csv
<p>I am parsing through vba macros encrypted Excel file and trying to copy all of the sheets in the Excel file but my script keeps blowing up. What am I doing wrong in my snippet.</p>

<pre><code>import csv
import xlrd

workbook = xlrd.open_workbook('P:/NEW.xlsm')
for sheet in workbook.sheets():
    with open('{}.csv'.format(sheet.name), 'wb') as f:
        writer = csv.writer(f)
        writer.writerows(sheet.row_values(row) for row in range(sheet.nrows))
</code></pre>

<p>Error:</p>

<pre><code>Traceback (most recent call last):
  File "C:/Users/datainput.py", line 8, in &lt;module&gt;
    writer.writerows(sheet.row_values(row) for row in range(sheet.nrows))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 20: ordinal not in range(128)
</code></pre>