Aggiorna automaticamente l oggetto OLE
Il seguente codice di esempio carica il file Excel di esempio che contiene un’immagine OLE non reale. L’oggetto OLE è effettivamente un documento di Microsoft Word ma il file Excel di esempio mostra l’immagine dell’animale invece dell’immagine di Microsoft Word. Ma se si apre il file Excel di output, si vedrà che Microsoft Excel mostra l’immagine OLE corretta.
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) |