Saving an excel with one extension type to another type

Hello Forum,
I would really appreciated if you could help me with this problem.

1 my get outlook mail message is set to identify if an email has an excel attachment (which can be : “.csv” ; .“xls” or “.xlsx” extension types).
Then i have to save these attachments in a folder.
But the problem is : i have to save this folder (no matter the extension types is) . but i have to save the file with a “.xlsx” extension type).
Please any advice if there is one activity allowing us to make it or we need to create a parallel workflow to acomplish this goal…
Thanks in advance,
Ricch

Hey, you will be able to achieve it by using the activity Move File:

As an example:

yourFilePath = “C:\Users\yourUser\Downloads\Employees.csv”
yourFolderPath = “C:\Users\yourUser\Downloads”

If you add the +/Employees.xlsx at the end, then you will have an extra copy of your file with the right extension.
You could also try using the Rename File activity but the Move File is my go-to activity for these cases.

Hope it helps!

2 Likes

You could try reading the csv or xls and write back as .xlsx
image

You can retain the attachment name if needed by using Path.GetFileNameWithoutExtension(CsvFilePath) + ".xlsx"

1 Like

Hi,

Can you try to use SaveExcelFileAs activity as the following?
This can convert xls or csv etc to xlsx.

Sample20230421-1L.zip (9.4 KB)

Regards,

1 Like

@Ricchch

First do a save attachments into folder…save attachment activity would help in that

Next for conversion

Usefor eaxh file in folder activity and use if condition to check extension is csv or xls

And then for csv use read cav activity and then write data to .xlsx file using use excel activity which will automatically create a file if not exists

Similarly read the data from .xls and repeat the same process of writing with create if not exists check box

Cheers

1 Like

Thank you to all,
I will work on that today… and then i come back to you .
really appreciated your advices.
Ric

2 Likes

Hello @Yoichi,
thank you very much!
Doomo Arigatoo Gozaimas!!
:handshake:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.