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


#1

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


#2

Hi @Rahul_S ,

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


#3

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