إزالة عنصر تحكم ActiveX باستخدام ++C
Contents
[
Hide
]
إزالة عنصر تحكم ActiveX
توفر Aspose.Cells القدرة على إزالة عنصر تحكم ActiveX من دفاتر العمل. لهذا، يوفر API الطريقة Shape.RemoveActiveXControl. يوضح مقتطف التعليمات البرمجية التالي استخدام طريقة Shape.RemoveActiveXControl لإزالة عنصر تحكم ActiveX.
الكود المثالي
#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;
int main()
{
Aspose::Cells::Startup();
// Source directory path
U16String srcDir(u"..\\Data\\01_SourceDirectory\\");
// Output directory path
U16String outDir(u"..\\Data\\02_OutputDirectory\\");
// Create a workbook
Workbook wb(srcDir + u"sampleUpdateActiveXComboBoxControl.xlsx");
// Access first shape from first worksheet
Shape shape = wb.GetWorksheets().Get(0).GetShapes().Get(0);
// Remove Shape ActiveX Control
shape.RemoveActiveXControl();
// Save the workbook
wb.Save(outDir + u"RemoveActiveXControl_out.xlsx");
std::cout << "ActiveX Control removed successfully!" << std::endl;
Aspose::Cells::Cleanup();
}