自動的にOLEオブジェクトを更新
Contents
[
Hide
]
Aspose.Cells for Python via .NETは、OleObject.auto_loadプロパティを提供しており、Microsoft ExcelでExcelファイルを開いたときにOLEオブジェクトを更新します。このプロパティのおかげで、OLEオブジェクトはMicrosoft Excelによって生成された正しいOLE画像を表示します。
次のサンプルコードでは、実際のOLEイメージでないOLEオブジェクトを含むサンプルExcelファイルを読み込みます。OLEオブジェクトは実際にはMicrosoft Wordドキュメントですが、サンプルExcelファイルではMicrosoft Wordイメージの代わりに動物のイメージが表示されます。しかし、出力Excelファイルを開くと、Microsoft Excelが正しいOLEイメージを表示します。
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 SaveFormat, 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(".") | |
# Create workbook object from your sample excel file | |
wb = Workbook(dataDir + "sample.xlsx") | |
# Access first worksheet | |
sheet = wb.worksheets[0] | |
# Set auto load property of first ole object to true | |
sheet.ole_objects[0].auto_load = True | |
# Save the worbook in xlsx format | |
wb.save(dataDir + "RefreshOLEObjects_out.xlsx", SaveFormat.XLSX) |