Excel Extension

Hi I have one folder which have files like pdf , message , text , excel
Now I want to work on excel butexcel extension is not its changing in every run
How can bot identify excel
Please help

Hi @Kuldeep_Pandey

Try this

“*.xlsx”

We have .xlsm So it will work or not?

Hi @Kuldeep_Pandey
Give the expression as below. It will consider only .xlsx files in that particular folder.

Directory.GetFiles(your input, "*.xlsx")

Hope it helps!!

It’s work

image

@Kuldeep_Pandey

Take the folder path by assigning variable = Directory.GetFiles(Your Folder path)
Use for each file in folder and pass the variable.
In that use the filter and pass “*.xlsx”
Now you can do your actions within that for each file in folder activity.

Hope it works!!

@Kuldeep_Pandey

If you have xlsm files then try like this

image

I have many excel extension like .xlsx and xlsm and many more
So it will work for all?

Hi @Kuldeep_Pandey

Use the For each file in folder activity to iterate the files in the folder.
In the option of the activity You can give the filter to get the xlsx files means excel files.

Give the below one for three extensions

"*.xlsx,*.xlsm,*xls"

Please check the below image for your reference
image

Hope it helps!!

That the thing I am telling you extension is not same in every run it will change
So i need solution for this

@Kuldeep_Pandey

try to change the filter to “*.xls*
image

Regards

@Kuldeep_Pandey
Try with using Wild card entries.So, it will run through each file of excel “.xls * " or ".xls?”

Hope it helps!!

@Kuldeep_Pandey

You can try like this

image

@Kuldeep_Pandey


MicrosoftTeams-image (14)

It works!!

xls
Is it will work for all?

@Kuldeep_Pandey

Yes it will work for all the types of excels extension

Regards


We have these ,So it will capture all or not?

@Kuldeep_Pandey

Yes it will work for all.

Regards

@Kuldeep_Pandey

Change the filter condition to "*.xl*"

because you have .xltx extension also please change as per this.

Regards

@Kuldeep_Pandey

If you find the solution for your query please do mark as solution to close the loop

Happy Automation!!