New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content is unreadable in excel #212

Closed
SeanWhipple opened this Issue Jan 16, 2015 · 2 comments

Comments

2 participants
@SeanWhipple

SeanWhipple commented Jan 16, 2015

I have the following code

workbook = xlsxwriter.Workbook('test.xls')
worksheet = workbook.add_worksheet()

e_opts = ['test5', 'other']

for i in range(10):

    worksheet.write('A%d'%i, 'test1')
    worksheet.write('B%d'%i, 'test2')
    worksheet.write('C%d'%i, 'test3')
    worksheet.write('D%d'%i, 'test4')
    worksheet.write('E%d'%i, 'test5')

    worksheet.data_validation('E%d'%i, {'validate': 'list',
                                        'source': e_opts})

workbook.close()

And when trying to open in Excel I get a content is unreadable error. After repairing, there is nothing left in the spreadsheet

@jmcnamara

This comment has been minimized.

Show comment
Hide comment
@jmcnamara

jmcnamara Jan 16, 2015

Owner

Hi,

Thanks for the detailed report.

The issue is that the program is writing to cell 'A0'.

Something like the following will work:

for i in range(1, 10):
   # Same as before

# or 

for i in range(10):
    worksheet.write(1, 0, 'test1')

However, the module should raise an error. I'll fix that.

John

Owner

jmcnamara commented Jan 16, 2015

Hi,

Thanks for the detailed report.

The issue is that the program is writing to cell 'A0'.

Something like the following will work:

for i in range(1, 10):
   # Same as before

# or 

for i in range(10):
    worksheet.write(1, 0, 'test1')

However, the module should raise an error. I'll fix that.

John

@jmcnamara jmcnamara added the bug label Jan 16, 2015

@jmcnamara jmcnamara self-assigned this Jan 16, 2015

@SeanWhipple

This comment has been minimized.

Show comment
Hide comment
@SeanWhipple

SeanWhipple Jan 16, 2015

Silly mistake on my part, thanks for the help!

SeanWhipple commented Jan 16, 2015

Silly mistake on my part, thanks for the help!

jmcnamara added a commit that referenced this issue Jan 19, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment