Aktualisieren Sie das OLE-Objekt automatisch über Microsoft Excel mit Aspose.Cells

Aktualisieren Sie das OLE-Objekt automatisch über Microsoft Excel mit Aspose.Cells

Der folgende Beispielcode lädt dieExcel-Beispieldatei die ein nicht echtes OLE-Bild hat. Das OLE-Objekt ist eigentlich ein Microsoft-Word-Dokument, aber die Excel-Beispieldatei zeigt das Tierbild anstelle des Microsoft-Word-Bilds. Aber wenn Sie die öffnenExcel-Datei ausgeben, sehen Sie Microsoft Excel zeigt das richtige OLE-Bild an.

Der folgende Screenshot zeigt, wie dieExcel-Beispieldatei sieht aus, wenn es in Microsoft Excel geöffnet wird.

todo: Bild_alt_Text

Der folgende Screenshot zeigt, wie dieExcel-Datei ausgeben sieht aus, wenn es in Microsoft Excel geöffnet wird.

todo: Bild_alt_Text

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// The path to the documents directory.
String dataDir = Utils.getDataDir(AutomaticallyrefreshOLEobject.class);
// Create workbook object from your sample excel file
Workbook wb = new Workbook(dataDir + "sample.xlsx");
// Access first worksheet
Worksheet sheet = wb.getWorksheets().get(0);
// Set auto load property of first ole object to true
sheet.getOleObjects().get(0).setAutoLoad(true);
// Save the worbook in xlsx format
wb.save(dataDir + "output.xlsx", SaveFormat.XLSX);