I am writing on python3.4 xlsxwriter 0.9.3
and@and-MS-1738 ~ $ uname -a Linux and-MS-1738 3.16.0-38-generic #52~14.04.1-Ubuntu SMP Fri May 8 09:43:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux Program:
# -*- coding: utf-8 -*- import xlsxwriter, os file = 'data.xlsx' path = os.getenv("PWD", os.getcwd()) wb = xlsxwriter.Workbook(path + '/' + file) ws = wb.get_worksheet_by_name("Поколение") print("Листы:", wb.worksheets()) ws.write(0, 0, "123456") wb.close() when starting, I get:
Листы: [] Traceback (most recent call last): File "тест2.py", line 8, in <module> ws.write(0, 0, "123456") AttributeError: 'NoneType' object has no attribute 'write' In the current directory there is exactly a file data.xlsx and there’s exactly a “Generation” sheet. Moreover, I can add a sheet using the add_worksheet method without problems and then write to it, but I cannot get an object of an existing sheet into any. What am I doing wrong?