我正在尝试使用xlsxtwriter模块将图像添加到现有的excel表中
import xlsxwriter
workbook = xlsxwriter.Workbook('C:/Users/Desktop/blank.xlsx')
worksheet = workbook.get_worksheet_by_name('Sheet1')
worksheet.insert_image('B5', 'C:/Users/Desktop/CaseDeatails/Abc.jpg')
我得到下面的错误
回溯(最近一次呼叫): 文件“C:\Users\Desktop\插入图像.py“,第23行,英寸 工作表.插入图片('B5','C:/Users/Desktop/CaseDeatails/Abc.jpg公司') AttributeError:“NoneType”对象没有属性“insert\u image”
请帮我解决这个错误
自从it cannot read or modify an existing file以来,XlsxWriter不可能做到这一点。在
请尝试使用OpenPyXL模块。在
相关问题 更多 >
编程相关推荐