Aggiorna automaticamente l oggetto OLE tramite Microsoft Excel utilizzando Aspose.Cells
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.
// 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); |