Click checkbox in excel file

Hey,

I have multiple check boxes in an excel file. Any idea on how to click them? The Click activity does not seem to work. It highlights the entire page

Do you have a sample excel file for us?

Ah I wish I could but its an internal document.

What other options do we have for this?

I would say just use excel scope activity with the Visible option as true and click where you need to, if you cant make a real selector than use some of the image click options, will work eventually. For the sample you could remove everything and leave just those checkbox columns…

It wont let me upload the file. its an excel file

Hi @Asanka

Once Try using Check Activity
image

Mark as solution and like it if it helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

will this work in an excel application scope?

Hi @Asanka

Try it using Excel Application Scope as @bcorrea said.

If not then without Excel Application Scope you can try.

Just try and check. Sometimes at 1st time itself it works without trying previously. :sweat_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

I dont have that activity. What package is it under?

Hi @Asanka

image
image

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

Hey,

I was actually able to get it to check using VBA. I just recorded the macro and it works. However, I don’t want to use “Execute Macro” because I don’t want these macros housed in the actual excel file. I tried to use invoke VBA code but when it runs it, it does not work. I just pasted the excel vba into a txt file but it doesn’t work. Any ideas whats wrong with the below code? I think I am missing something:

Sub Macro3()
’
’ Macro3 Macro
’

’
ActiveSheet.Shapes.Range(Array(“Check Box 1”)).Select
With Selection
.Value = xlOn
.LinkedCell = “”
.Display3DShading = False
End With
End Sub

Yeah I dont have that package or some reason

I guess I’m asking how do you convert a macro into VBA

Hi @Asanka

This is one of the dummy example for the same
InvokeVBA Example.zip (15.7 KB)

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

Hey yeah so I get how to use the invoke vba. I’m just wondering why the actual vba is not working. If I run the macro in excel it works fine. however, if I take that code and store it in a text file and then invoke the vba it does not work. I don’t even get an error. It just doesn’t work

Interesting.

I did a reboot and now I get this error when trying to invoke the code:

Source: Invoke VBA

Message: Cannot run the macro ‘CheckBox’. The macro may not be available in this workbook or all macros may be disabled.

Macros are enabled

HI @Asanka

Check below threads for the same :-

Enable or disable macros in Microsoft 365 files - Microsoft Support

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:


and
image

Thanks! I just needed to reboot and its all good now!