troubleshooting Question

How to change a checkbox value in Excel

Avatar of aviveros
aviveros asked on
Visual Basic ClassicVB Script
8 Comments1 Solution650 ViewsLast Modified:
Hi, I am designing a program in VB6, this program reads an employees database, opens a Excel file and fills many fields in a designed format. The program doesn't have problems to write data in the cells, but I can't change the value in the checkboxs the form has. For example, in the form there are 2 checkboxs which indicate the sex: one for indicate if the person is masculine and other for indicate if the person is feminine. So, depending on the values the program reads from the database, it has to turn on one check box and turn off the other one. I created a macro in Excel to see the code, but it doesn't work in VB. I copy the code of the macro below. Thanks.
    ActiveSheet.Shapes("Check Box 6").Select
    With Selection
        .Value = xlOn
    End With

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros