通过C++在Node.js中移除ActiveX控件
Contents
[
Hide
]
移除ActiveX控件
Aspose.Cells 提供了从工作簿中移除 ActiveX 控件的功能。为此,API 提供了 Shape.removeActiveXControl() 方法。以下代码片段演示了如何使用 Shape.removeActiveXControl() 方法移除 ActiveX 控件。
示例代码
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"));