Add filter to excel

I’m trying to add a filter into a Excel file, just the basic 1 (CTL+SHIFT+L).

I’m using a ‘Excel Application Scope’ with a ‘Type Into’ inside.

text:

"[d(ctrl)][d(shift)]l[u(ctrl)][u(shift)]"

selector:

< wnd app='excel.exe' cls='XLMAIN' title='LOG_*' / >
< wnd cls='EXCEL7' title='LOG_*' / >

I then open manually the excel and no filter are applied at all, the robot don’t crash tho.

I’m sorry for the lack of information as I can’t post any code here.

Hi @MaxyArthes

Use write range activity on the same file name or use save workbook activity

Thanks
Ashwin.S

Hi @MaxyArthes

Also instead of Type into activity you could the “send hotkeys activity”

Cheers!

Tried, in my Excel Application Scope I got: Send Hotkey (ctl+shift + l) and a write range from “A1”. Still no filter when I open the Excel =/

Tried with both, same result sadly

@MaxyArthes - using hotkeys can be a bit finicky in excel i’ve noticed. First thing make sure you use the ‘Select cell’ activity to select one of the headers in the table you’re trying to filter. Then use the send hotkey or send keys activity. If the hotkey you tried didn’t work, try sending the following keys with a 200ms lag time (using standard keyboard, not SendWindowsMessages or SimulateType). alt + a + t

If none of those suggestions work, you could create a simple macro within the workbook, or a .vbs file to run a filter. You can pass in the range in you want to run the autofilter as an in argument for the macro and it would only be a couple lines long

@MaxyArthes

Check the attached project.
FilterDemo.zip (70.0 KB)

Hi @MaxyArthes

Use select range activity and use type into or send hot key

Thanks
Ashwin.S

After trying different things, the save workbook activity was actually the solution. x)

Thanks!

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