How to read Excel file dynamically?

Hey @TGS5

Just a quick sample for u - read all excel files only from a folder sample.xaml (7.2 KB)

String[ ] return_Value = Directory.GetFiles(“F:\Test",”*.xlsx") // This will return you only the *.xlsx files from a particular folder path only.

Directory.GetFiles(“”,“”)

path
Type: System.String

The relative or absolute path to the directory to search. This string is not case-sensitive.

searchPattern
Type: System.String

The search string to match against the names of files in path. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters (see Remarks), but doesn't support regular expressions.

Return Value
Type: System.String

An array of the full names (including paths) for the files in the specified directory that match the specified search pattern, or an empty array if no files are found.

Regards…!!
Aksh