编辑工作表的超链接
Contents
[
Hide
]
Aspose.Cells for Python via .NET 允许您使用 Worksheet.hyperlinks 集合访问工作表的所有超链接。您可以逐个访问此集合中的每个超链接并编辑其属性。
以下示例代码访问工作表的所有超链接,并将它们的 Hyperlink.address 属性更改为 Aspose 网站。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from aspose.cells import Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
workbook = Workbook(dataDir + "Sample.xlsx") | |
worksheet = workbook.worksheets[0] | |
for i in range(len(worksheet.hyperlinks)): | |
hl = worksheet.hyperlinks[i] | |
hl.address = "http://www.aspose.com" | |
workbook.save(dataDir + "output_out.xlsx") |