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

Contents
[ ]

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.

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Create workbook object from your sample excel file
Workbook wb = new Workbook(dataDir + "sample.xlsx");
// Access first worksheet
Worksheet sheet = wb.Worksheets[0];
// Set auto load property of first ole object to true
sheet.OleObjects[0].AutoLoad = true;
// Save the worbook in xlsx format
wb.Save(dataDir + "RefreshOLEObjects_out.xlsx", SaveFormat.Xlsx);