Check format file

Good afternoon! I download files from the site, I need to check the files for format.
You can do this:

  1. If the first docx, and the second excel - then download.
    Then open excel first (names unknown in advance)
  2. Download. If there is an Excel file - open
    How to do it?
1 Like

Hi
For both scenarios it seems like we need to open Excel first right
In that case
Once after downloading and Saving to a folder
—use a assign activity like this
arr_filepath = Directory.GetFiles(“yourfolderpath”,”*.xlsx”)

Where arr_filepath is a variable of type array of string which will have only xlsx files in it

—now use a FOR EACH activity and pass the above array variable as input
—inside the loop use EXCEL APPLICATION SCOPE and mention the input file path as item.ToString

Cheers @RPA3

1 Like

An array is not needed. the file will be 1 with this format

1 Like

Then we can mention like
Str_filepath = Directory.GetFiles(“yourfolderpath”,”*.xlsx”)(0).ToString

Then pass it directly to excel application scope with input as str_filepath

Cheers @RPA3

How?

Oh is my comment coming like this
@RPA3

In Directory.GetFiles(“yourfolderpath”,”*.xlsx”)(0)

Here yourfolderpath mean the folder path of where excel file is downloaded

And in excel application scope pass the input as str_filepath as now that is the variable which holds the excel file path right

Inside that scope we can use any excel activity we want
Cheers @RPA3

What if the file was not downloaded and the folder already had other excel files, I don’t need to open the old ones