我正在使用openpyxl来读取单元格值(excel addin-webservice更新此列.)
我已经使用data_only = True但它没有显示当前单元格值,而是它是上次Excel读取工作表时存储的值.
wbFile = openpyxl.load_workbook(filename = xxxx,data_only=True)
wsFile = wbFile[c_sSheet]
Run Code Online (Sandbox Code Playgroud)
我如何读取单元格的实际值?
我正在使用openpyxl库在单独的单元格中写入现有的 Excel 文件。
如何在 Excel 合并单元格中写入一些文本?
错误 AttributeError: 'MergedCell' object attribute 'value' is read-only
合并单元格时:
代码:
wb = openpyxl.load_workbook(filename=src)
for row in df_short.itertuples():
ws = wb[row.sheet]
try:
cell = 'N'+str(row.id)
ws[cell] = '=HYPERLINK("%s","#%s")' % (row.txt_path, row.txt)
Run Code Online (Sandbox Code Playgroud)