Get all files with .xlsx , .xls, .XLS, .XLSX extensions from folder

Hello,

I want to get all files from Specific folder with .xlsx , .xls, .XLS, .XLSX extensions.

I am trying following way but it returns only files with one extension.

Directory.GetFiles(selectFolder,"*.xlsx")

Thanks in Advance

Hi @Rahul_S ,

Try Below code
Directory.GetFiles(selectFolder,"*.xls*")

3 Likes

Hi @Rahul_S - Attached is the sample example for your reference.GetFilesWithSpecifiedExtenstion.xaml (7.8 KB)

Just give the path of the folder to FolderPath variable. It will return you the all the file names with .xlsx and .xls extension.

Hope this will help and let me know for any clarification.

Regards,
Nitesh

1 Like

Hi, can I knwo how to include .csv as well?