//Open your sample Excel file
Workbook wb = new Workbook("sample.xlsx");
//Access first worksheet
Worksheet ws = wb.Worksheets[0];
//Access combo box, change its fill range and value property
Aspose.Cells.Drawing.ActiveXControls.ComboBoxActiveXControl combo = ws.Shapes[0].ActiveXControl as Aspose.Cells.Drawing.ActiveXControls.ComboBoxActiveXControl;
combo.ListFillRange = "J1:J4";
combo.Value = "Apple";
//Save the output Excel file
wb.Save("output.xlsx");
Well, you may add/update VBA codes/macros via Aspose.Cells APIs but you cannot execute macros/vba codes. See the documents in the section for your complete reference on how to add/assign or modify vba codes and macros:
You have to open the file into MS Excel to call the macros/vba codes.
Thank you.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.