Date format is applied to all columns (while only first column contains dates)

Issue #394 resolved
David Laudy
created an issue

I have a problem when writing an excel file containing a date column and a value column as date format is applied to both column (instead of first one).

Thanks!

import datetime as dt
import openpyxl
import os
import os.path as osp

workbook = openpyxl.workbook.Workbook(optimized_write=True)
sheet = workbook.create_sheet()
sheet.title = u'hello'

rows = [(dt.date(2001,1,1), 1),
        (dt.date(2001,1,2), 2),
        (dt.date(2001,1,3), 3),
        ]

for stamp, val in rows:
    sheet.append([stamp, val])

workbook.save(osp.join(os.getcwd(), 'test.xlsx'))

Comments (2)

  1. Log in to comment