使用 xlwings 在 Excel 中插入图像
Insert image in Excel using xlwings
我尝试使用以下命令在 Mac 上使用 xlwings / appscript 将图像插入到 Excel:
Sheet('sheet1').xl_sheet.shapes.pictures.open('test.png')
但结果是用图像代码打开了一个Excel工作簿。
我尝试了很多扩展,但没有找到正确的扩展。
xl_sheet.shapes.pictures.width
xl_sheet.shapes.pictures.height
xl_sheet.shapes.pictures.drop
有人知道如何处理它吗?如果它存在 Python 的 AppleScript 文档?
现已与 xlwings v0.5.0 一起发布:
示例:
import xlwings as xw
pic = xw.Picture(1, 'picture_name') # To manipulate an existing picture
pic = xw.Picture.add('path/to/picture.jpg', sheet=1) # add a new one
详情见docs。
我尝试使用以下命令在 Mac 上使用 xlwings / appscript 将图像插入到 Excel:
Sheet('sheet1').xl_sheet.shapes.pictures.open('test.png')
但结果是用图像代码打开了一个Excel工作簿。 我尝试了很多扩展,但没有找到正确的扩展。
xl_sheet.shapes.pictures.width
xl_sheet.shapes.pictures.height
xl_sheet.shapes.pictures.drop
有人知道如何处理它吗?如果它存在 Python 的 AppleScript 文档?
现已与 xlwings v0.5.0 一起发布:
示例:
import xlwings as xw
pic = xw.Picture(1, 'picture_name') # To manipulate an existing picture
pic = xw.Picture.add('path/to/picture.jpg', sheet=1) # add a new one
详情见docs。