dimanche 29 mars 2015

Saving excel work book not working in python


for sheet_name in book.sheet_names():
for index in range(len(tabs)):
tab = tabs[index]
if sheet_name == tab:
dump_file_name = dump_files[index]
dump_file_name = file_prefix+dump_file_name
sheet = book.sheet_by_name(sheet_name)

new_book = Workbook()
sheet1 = new_book.add_sheet("Sheet 1")

for row in range(sheet.nrows):
values = []
for col in range(sheet.ncols):

sheet1.write(row,col,sheet.cell(row,col).value)


xlsx_file_name = dirname+"/"+dump_file_name+".xlsx"
sheet1.title = xlsx_file_name
new_book.save(xlsx_file_name)


file is creating and data is there but if i open it in open offcie org and click save button it asking for new name. The file can not be read by PHP also


Aucun commentaire:

Enregistrer un commentaire