Rimuovere il controllo ActiveX

Rimuovere il controllo ActiveX

Aspose.Cells offre la possibilità di rimuovere il controllo ActiveX dalle cartelle di lavoro. Per questo, lo API fornisce ilShape.RemoveActiveXControlmetodo. Il seguente frammento di codice illustra l’uso diShape.RemoveActiveXControlmetodo per rimuovere il controllo ActiveX.

Codice d’esempio

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
//Source directory
string sourceDir = RunExamples.Get_SourceDirectory();
//Output directory
string outputDir = RunExamples.Get_OutputDirectory();
// Create a workbook
Workbook wb = new Workbook(sourceDir + "sampleUpdateActiveXComboBoxControl.xlsx");
// Access first shape from first worksheet
Shape shape = wb.Worksheets[0].Shapes[0];
// Access ActiveX ComboBox Control and update its value
if (shape.ActiveXControl != null)
{
// Remove Shape ActiveX Control
shape.RemoveActiveXControl();
}
// Save the workbook
wb.Save(outputDir + "RemoveActiveXControl_our.xlsx");