Aggiorna automaticamente l OLE object tramite Microsoft Excel usando Aspose.Cells for Node.js via C++

Contents
[ ]

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.

const path = require("path");
const AsposeCells = require("aspose.cells.node");

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");

// Create workbook object from your sample excel file
const workbook = new AsposeCells.Workbook(path.join(dataDir, "sample_oleobject.xlsx"));

// Access first worksheet
const sheet = workbook.getWorksheets().get(0);

// Set auto load property of first ole object to true
sheet.getOleObjects().get(0).setAutoLoad(true);

// Save the workbook in xlsx format
workbook.save(path.join(dataDir, "RefreshOLEObjects_out.xlsx"), AsposeCells.SaveFormat.Xlsx);