Save as/system date and time/attach into mail

Hi Everyone,

I wish all be in Safe and together with your families on Current Covid-19 Pandemic situation.

I need some assistance on my bot creation issue. I am trying to make some changes in excel after download from Service now. While changes done and trying to save the file, i need to get the Sysdate and time and save as html format.

Till save as .html format is completed. But the file name must be dynamic on all time whenever the bot get run and the file name must be as “Sysdate and time”

Anybody worked on this case and suggest me some way to fix this. I was tried many ways to fix this from couple of days, but unable to get it fixed. :frowning:

Note:- While save the file sequence is running in Excel application scope.

Thanks a lot on all our valuable suggestions.

Thanks,
Janarthanan A

Hi @Janarthan_0310,

If I understood correct, you need to save the file with current date-time. Please try the below on file name.
System.DateTime.Now.ToString(“dd-mm-yyyy hh:mm:ss”)
OR
“SomeName”+"_"+System.DateTime.Now.ToString(“dd-mm-yyyy hh:mm:ss”)

1 Like

@cpatras @Janarthan_0310

“SomeName”+"_"+System.DateTime.Now.ToString(“dd-mm-yyyy hh:mm:ss”)

This will work except rather using ":" use a " " because file name would not entertain special symbols.

1 Like

@cpatras @Lakshay_Verma, I tried to do this as your suggestions. Error 1 error 2

Please find the attached error snap. As you both said, we must to encounter the special characters. On error 2, i tried to save the file as declared variable in screenshot. While saving, pop up on issue on Error 1 (Save As).

How to encounter this error through properties.

Much help getting from you all. Thanks a lot on your speedy reply on the issues.

Thanks,
Janarthanan A

Hi,

Do not use colon, Use

yyyy H mm ss

1 Like

Hi @Janarthan_0310

Please try DateTime.Now.ToString(“ddMMyyyyhhmmss”) and let me know if it works.

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