Excel Automatiom

Hi Everyone,

I have read all the excels(around 40), If any excel is not contain any data i need to delete, if the excel contains data I need to read those excels again for further calculations, i used if condition and displaying in message box the output is coming correctly,but while trying to delete the excel file with no data giving an error like " excel is in used cant delete".
Can any one please help me to resolve.

Hi @HeartCatcher You can give kill process before the Delete Process

Give it a try and let me know


you can check that excel have data or not by below code in if condition-

use delete activity in then condition
Note:- use if condition outside excel application scope

@manish_patel here i need not to read entire sheet, I just need to read a particular cell as attached

@Sudharsan_AIT , I tried but it is not deleting the files with no data.

you can put multiple if condition and check strvariable=nothing or strvariable.lenght=0 then delete it

don’t forgot to put if condition outside of excel application scope

1 Like

For that, you can use Kill process

1 Like

Try Saving before deleting

  1. Save Workbook
  2. Kill Process
  3. Delete

@Gokul001, ok whichever the excel contains data i need to use again for further calculation

Can you share the screenshot of you workflow?

-What activity was used in workflow to delete the excel file

Okay Can you give the Overview of your Task?

I used kill process as you said

You try with StudioX


I want to read the excels(40 excels) daily, then i want to skip/delete the excel with no data, I only take the excels which contains data, from this excels I need to look for ACH DR/CR, ACH DR/CR_R then i need to check this in another excel to match ACH DR/CR on which code it is matching i need to fetch the Account number which is present below of ACH DR(debit)/CR(credit).
based on the account number I need to fetch the amount present in matched excel and in master excel to which account number is matching.

In that Case you can skip to next iteration instead of deleting

@HeartCatcher Are you using if condition inside for each?

Yes I am using If condition

Before this I will download the excel files from the client portal. After that I need to follow the things as i said in previous message.

If the excel has empty fields you need to skip that entire excel or delete it is that right?

Yes, Perfect