Eliminar Control ActiveX
Contents
[
Hide
]
Eliminar control ActiveX
Aspose.Cells proporciona la capacidad para eliminar un Control ActiveX de hojas de cálculo. Para esto, la API proporciona el método Shape.RemoveActiveXControl. El siguiente fragmento de código demuestra el uso del método Shape.RemoveActiveXControl para eliminar el Control ActiveX.
Código de muestra
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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"); |