Just so that people reading this thread can quickly know what the suggested answer was from @Nithinkrishna
Step 1. Use Start Process activity and provide the full path to your .xlsx file. This ensures that your .xlsx file is opened with the default application in this case .xlsx opens in excel. But if you have a .pdf file then the default PDF reader you use will open the .pdf file.
Step 2. Using Excel Application Scope you can then read the .xlsx file opened previously in Step 1. This works because UiPath Excel Application Scope checks if the same file is already opened before, if yes, then it uses the instance which is already opened.
Same is true when you use this technique to other file types .pdf, .docx etc. Remember that, in all cases of this solution the opened process will not close unless a kill process activity or another soft way of closing the application / file is used.
Thanks a lot to both Jeevith and Nithinkrishna. But I encountered some issues, Step 1. Use Start Process activity It opened EXCEL successfully but pop out error " Application can’t be opened". I solved it by putting FileName as “\off16\excel.exe” and Argument as “”" ABC.xlsx"“” by triple-quot. Don’t know why and I got the solution from some threads in the forum Step 2. Using Excel Application Scope It will open another instance and set it as read-only file even though I unchecked CreateNewFile in the application scope property.
Thanks in advance for further help.