Hi,
I am trying to change the checked flag of several checkboxes in Excel via vb.net code.
The first workbook has no problems, I simply open the excel file in Excel and look at the checkbox names. Then I open the file thru Aspose api, loop thru the aspose checkbox collection in code and set the values when the names match up.
Unfortunately, the other workbook I have isn’t working the same. I have a few checkboxes that are named “Checkbox 1, Checkbox 2…etc” in Excel. But when I loop thru the Aspose checkbox collection, the names don’t match all. They are like “Checkbox 120, Checkbox 121, … etc”.
Any ideas why the checkbox names match in one workbook, but not another ?
I’m using v4.6.
Thanks!
Hi,
Thank you for considering Aspose.
Please try the attached latest version of Aspose.Cells. If you still face any problem, please share your template file and sample code here. We will check it soon.
Thank You & Best Regards,
This new version solved the problem. I’ll need updated license, but I don’t think that will be an issue.
Thanks!
I am using Aspose.cell, in one of my excel cell I am adding checkbox , when I click on that checkbox it display “True” behind the checkbox and “false” when unclicked.
I don’t want to display the checkbox value in the excel sheet , how this can be achieved.
I am using c#, with Aspose.cells
Please do not set linked cell if you do not want to retrieve the checked/unchecked value. See the sample code segment for your reference (see the commented line of code which you should not use):
e.g
Sample code:
Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];
Aspose.Cells.Cells cells = workbook.Worksheets[0].Cells;
//Add Checkbox
CheckBoxCollection checkboxes = sheet.CheckBoxes;
int index = checkboxes.Add(3, 1, 60, 80);
Aspose.Cells.Drawing.CheckBox checkbox = checkboxes[index];
checkbox.Text = "MyCheckbox";
//Do not set the linked cell attribute
//checkbox.LinkedCell = "A1";
checkbox.Value = false;
workbook.Save("e:\\test2\\out1.xlsx");
Hope, this helps a bit.