为什么“WriteOnlyWorksheet”对象没有属性“cell”?

Lmo*_*orj 2 python cell openpyxl

import openpyxl

wb=openpyxl.Workbook("multiplication.xlsx")
wb.create_sheet()
sheet=wb.get_active_sheet()

sheet.cell(column=6, row=4).value= 5

wb.save("multiplication.xlsx")
Run Code Online (Sandbox Code Playgroud)

当我尝试在单元格中写入时,我收到此错误。

Traceback (most recent call last):
  File "/Users/bjg/Desktop/excel2.py", line 8, in <module>
    sheet.cell(column=6, row=4).value= 5
AttributeError: 'WriteOnlyWorksheet' object has no attribute 'cell'
Run Code Online (Sandbox Code Playgroud)

我想知道是否有人知道为什么会出现这种情况?

use*_*ica 5

只写模式文档

在只写工作簿中,只能使用append(). 无法使用cell()或在任意位置写入(或读取)单元格iter_rows()