How can i use for loop here

Just suppose I have 5 excel doc in my folder and I want my robot to open each document one by one and then close it.

Like, open doc1 and close it , then open doc2 and close it just like that
so what do i need to do here???

Hi @Ravi_Ranjan

variable list_files = Directory.GetFiles(Folder_Path) → this gets all the file paths in the folder, use for each and loop through each file path. Use excel activities to perform your action within For Each body.

Since you want to open and close, use Excel Scope, in the properties check Visible, as below

hope this is helpful

You left out the actual For Each.

image

Make sure to set the datatype of the For Each to string so that “file” will be the path and filename.

:grinning: good catch, I concentrated more opening and closing of excel