Save Excel Sheet with Today's Date

I have a Workflow that will run each day and create an excel spreadsheet. Is there a way to save the new excel sheet under that day’s date. IE. If today was 06/05/2022 when the flow was run it would save the excel sheet as “Excel Name - 06/05/2022”?

Hi,

Unfortunately, sheet name of Excel is not allowed to use “/” character. So we need to compromise it as “06052022” for example.

If we use WriteRange activity as the following and there is no sheet which has the name, the sheet will be created.

image

Now.ToString("MMddyyyy")

Regards,

Awesome thanks. Is there a way to do this for the whole excel workbook?

Hi,

Do you mean filename?
Can you share expected output for understand your requirement clearly?

Regards,

Yes, same as the answer of @Yoichi, but instead of “test.xlsx” replace it with

"Excel Name - " & Now.ToString(“mmddyyyy”)

Also as @Yoichi mentioned, the “/” date separator would not be allowed in filenames so you can also try other separator such as “-”

1 Like

what would the format be using that formula with the .xlsx at the end? I keep getting either “End of expression expected” or if i dont add the .xlsx it says expects format .xlsx

Hi,

Can you try as the following?

image

"PrefixString"+Now.ToString("MMddyyyy")+".xlsx"

Regards,

2 Likes

Its working now. Thanks!

1 Like

var1=now.tostring(“dd-MM-yyyy”)
“Filename-”+var1.replace(“-”,“/”)+“.xlsx”

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