I've edited the post to reflect the changes recommended.
def Excel2CSV(ExcelFile, Sheetname, CSVFile):
import xlrd
import csv
workbook = xlrd.open_workbook('C:\Users\Programming\consolidateddataviewsyellowed.xlsx')
worksheet = workbook.sheet_by_name (ARC)
csvfile = open (ARC.csv,'wb')
wr = csv.writer (csvfile, quoting = csv.QUOTE_ALL)
for rownum in xrange (worksheet.nrows):
wr.writerow(
list(x.encode('utf-8') if type (x) == type (u'') else x
for x in worksheet.row_values (rownum)))
csvfile.close()
Excel2CSV("C:\Users\username\Desktop\Programming\consolidateddataviewsyellowed.xlsx","ARC","output.csv")
It displays the following error.
Traceback (most recent call last):
File "C:/Programming/ExceltoCSV.py", line 18, in <module>
File "C:/Programming/ExceltoCSV.py", line 2, in Excel2CSV
import xlrd
ImportError: No module named xlrd
Any help would be greatly appreciated.