إزالة عنصر تحكم ActiveX

إزالة عنصر تحكم ActiveX

توفر Aspose.Cells لـ Python via .NET القدرة على إزالة تحكم ActiveX من دفاتر العمل. لهذا، يوفر API الأسلوب Shape.remove_active_x_control. يوضح المثال التالي استخدام أسلوب Shape.remove_active_x_control لإزالة تحكم ActiveX.

الكود المثالي

from aspose.cells import Workbook
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET
# Source directory
sourceDir = RunExamples.Get_SourceDirectory()
# Output directory
outputDir = RunExamples.Get_OutputDirectory()
# Create a workbook
wb = Workbook(sourceDir + "sampleUpdateActiveXComboBoxControl.xlsx")
# Access first shape from first worksheet
shape = wb.worksheets[0].shapes[0]
# Access ActiveX ComboBox Control and update its value
if shape.active_x_control != None:
# Remove Shape ActiveX Control
shape.remove_active_x_control()
# Save the workbook
wb.save(outputDir + "RemoveActiveXControl_our.xlsx")