gpt4 book ai didi

python - 用户警告 : "Cannot parse header or footer so it will be ignored" on loading xlsm file

转载 作者:行者123 更新时间:2023-12-05 00:39:55 66 4
gpt4 key购买 nike

尝试使用 python 打开 xlsm 文件

下面是代码:

import libraries
import openpyxl
from openpyxl import load_workbook
from openpyxl import Workbook
from openpyxl.styles import colors
from openpyxl.styles import Color, PatternFill, Font, Border

#path of the source sheet
path = "C:\DATA\PYTHON\Practise\SysTSAutSW300PFCRebuildDemo.xlsm"
wb1 = load_workbook(path)

sheet = wb1.get_sheet_by_name('PFC_Rebuild')

celldata = sheet['L33']

print celldata

它给出了以下错误:

Warning (from warnings module): File "C:\Python27\lib\site-packages\openpyxl\worksheet\header_footer.py", line 49 warn("""Cannot parse header or footer so it will be ignored""") UserWarning: Cannot parse header or footer so it will be ignored

最佳答案

"""Cannot parse header or footer so it will be ignored"""

出现警告是因为您的 Excel 文件中有一个无法被 openpyxl 解析的页眉或页脚。如果您想摆脱警告,可以使用

从 excel 文件中删除页眉和页脚

File -> Info -> Check for Issues -> Inspect Document -> Remove your header and footer.

关于python - 用户警告 : "Cannot parse header or footer so it will be ignored" on loading xlsm file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54106638/

66 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com