Creation of Excel file with dynamic file name

Continuing the discussion from Create new excel (dynamic name) for web scraped information for each seperate web account:

Hi,

I get error while open the file after creation with dynamic File name as mentioned in relevant topic at the end.

kindly suggest any solution.

Regards,
ST

Hi @Shashi_T ,

Could you please share the filename part you specified in the workflow?

Warm regards,
Nimin

You can save EXCELSHEET dynamically by:

Sheetname+datetime.now(“hh_mm_ss_dd_MM_yyyy”).toString

Hi,

In this way m generating the filename,creation of file is working fine without nay error but after creation while opening its giving error which i have posted already.
If i dont use customize name of the FileName and pass directly TestCaseDetailsMaster.xlsx then it open without error.

image

image

Hi @Shashi_T,

Your file name formatting looks fine. Please add a ‘delay’ activity with a duration of 3 or 5 seconds after the ‘write range’ inside the loop and try it.

Warm regards,
Nimin

@Shashi_T

Can you please use workbook activites. Hope it will works

Thankq
Aman sheik

YUP…I was using Workbook activity earlier, It was not working. Now i replace it through Excel Scope activity and Write Range of it …now issue has been resolved but if PC doesnt installed MS office then it will be prob with Excel scope activity.

image

Ideally it should work with workbook too.

Regards,
$T.

Hi,
Can u please try by directly giving the below instruction in the excel scope instead of passing it through a variable
“Data\OUTPUT\TestCaseDetailsMaster_”+GetOutputFileCount.Tostring+“.xslx”

comment the assign activities and please make sure the variable which use “GetOutputfileCount” is Globalized.

It worked in my case.

yes tried, its working under “Excel Application Scope” but not with workbook.

Thanks :slight_smile:

Hi,
as far as i know there are two write range activities in the list. use the workbook write range used for workbook instead of using the write range which is used for excel. check the below picture. use the activity under workbook.
image
Mark this as solution if u think this is the solution.

Regards.