![](/img/trans.png)
[英]How to insert and format values cell by cell in an XLSX file using openpyxl
[英]Extract multiple hyperlinks from a cell of xlsx file using openpyxl
如果单元格包含多个超链接,则以下链接中提到的方法不起作用: Extracting Hyperlinks From Excel (.xlsx) with Python
有没有办法最好使用 openpyxl 库在一个单元格中提取多个超链接?
如果它是通过形状完成的,我不知道在同一个单元格中有多个超链接的任何其他方法,那么 Openpyxl 不能做。 必须使用Xlwings。
import xlwings as xw
wb = xw.Book('foo.xlsx')
ws = wb.sheets('Sheet1')
for shape in ws.api.Shapes:
print(f'Hyperlink: {shape.Hyperlink.Address}')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.