Not able to perform an operation on control which is developed on Excel

We have a scenario where we want to read the data and fill the from ( The from is developed in Excel). WE have n number of checkbox which needs to be checked based on the data we get however checking checkbox inside the Excel is not working we tried with Anchor based , image based and normal selector. It works sometime when Excel is opened. but when we use Excel Application scope it doesn’t work.


Processing: Template Census Generation Checklist - BOT 0080.xlsm…
I can’t upload .xlsm file , but i have attached the screen-shot.

For the checkbox, you need to right click on that checkbox and the open properties, in that there will be radio button to Check or Uncheck that checkbox

checkbox is inside an excel and right click is not an option.

when i check the excel below is the VB code , I tried to execute the macro but it is not working and i am getting an error that macro is not available. Then i try to invoke VBA code then also i am getting an error object required. Below is the VBS code

Can you send the settings that you used in Uipath, please? (The activities and properties)

As a simple work around did we try with HOT KEYs using SEND HOT KEY activity
It will work for sure but the thing is we need to use right number of and combination of keys to access those check boxes

Give a try checking those boxes with just your keyboard and get the keys to be used
Follow the same pattern with UiPath activity as a sequence
It will work for sure

Cheers @manishsoni0407

The reason why hot key may not be that efficient as there is 50-60 checkboxes in the same sheet. and we need to perform an operation in all those checkboxes. It is a form which is developed inside an excel. Any other option we do have ?

Then I believe vb script is efficient one and it can be called with Execute macro or invoke VBA activity

I will tell you a way to do that
In excel under View tab click on macro and click on RECORD MACRO

Then do all the steps you want so that those steps will saved as VBA script

Then stop the macro recording and get the script and save it In text file

Cheers @manishsoni0407

1 Like

That’s what i have done , WE can’t add new macro in the excel file as the file is coming from business thus i have copy the vba code which is written inside the excel(.xlsm) and save it as vbs file in uipath project. I call this vbs file against the excel but it is throwing an error saying object is required.

I have attached the error.

@charbel1 : Below is the project dependencies.

Try to convert it to .txt file instead of .vbs (just copy paste to a new file).

no luck, still getting the same error. I have opened the debug window of Excel

It seems that VBA isn’t recognizing CheckBox81 variable.

Which type of checkbox are you using? ActiveX Controls or Form Controls?

Best,
Charbel

It is an Activex controls

Okay, to be able to access your checkbox, here is the tweak that you want to make:

Instead of using:

CheckBox81

Use:

Sheet5.CheckBox81

Where Sheet5 is the variable name of your sheet:
image

Side note: Your VBA code won’t check the checkbox, it will only change its caption and color, do you actually want to click on it?

Best,
Charbel

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.