Remove ActiveX Control with Node.js via C++
Contents
[
Hide
]
Remove ActiveX Control
Aspose.Cells provides the ability to remove ActiveX Control from workbooks. For this, the API provides the Shape.removeActiveXControl() method. The following code snippet demonstrates the use of the Shape.removeActiveXControl() method to remove ActiveX Control.
Sample Code
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// Source directory
const sourceDir = path.join(__dirname, "data");
// Output directory
const outputDir = path.join(__dirname, "output");
// Create a workbook
const wb = new AsposeCells.Workbook(path.join(sourceDir, "sampleUpdateActiveXComboBoxControl.xlsx"));
// Access first shape from first worksheet
const shape = wb.getWorksheets().get(0).getShapes().get(0);
// Access ActiveX ComboBox Control and update its value
if (shape.getActiveXControl() != null) {
// Remove Shape ActiveX Control
shape.removeActiveXControl();
}
// Save the workbook
wb.save(path.join(outputDir, "RemoveActiveXControl_our.xlsx"));