What to Achieve:
Select data from a dropdown inside an Excel file.
Note:
Sure I can just use Write Cell to write despite the available values, but the Excel is for input of another robot, so I need to make sure only available values in entried (what I mean, if “Pie” is not on the selection, I should not enter it).
Hello @skini76, thank you for your reply. If there is any way to do this, I don’t mind whether it is with opening or without opening Excel Application Scope. If you’re feeling generous I’d like to know both ways so I can compare which one is more suitable in my case.
Opening the file in excel application - not very difficult, when you type a value outside the list, it throws an error (provided show error is enabled), you can capture the error using Image exists, will this work for you.
You can try this :
Use Excel Application Scope to open the excel sheet. Select Range - point to which ever cell that has the options Type into“[k(alt)]avv” Shortcut to go to Data Validations that has the options listed Get Text from the source field to get all options. Check if your option is available in the list.
If yes, then get the position of the option (1st / 2nd / 3rd / …) Click OK or cancel to dismiss the window.
You can either write the option using Write Cell , which ideally overwrites the cell content.
(OR)
With the range still selected Type into“[k(alt)][k(down)]” to open the ‘in cell dropdown’ list. Type into“[k(alt)][k(down)]” as many times as the position of the option (or one less than that) to move to the option. Type into“[k(enter)]” to choose the option.
Thank you @kaderms, never thought I could get the list from that window!
I hope there is easier way to do this, but for now it it enough! Thank you so much!
Yes, I thought of that too but decided it was more prone to mistakes.
Your suggestion to get the list from the Data Tab seems to be more stable so I’d try that one! @kaderms