Folder Structure error

Hi All,

I am getting the below error when using write range activity inside folder. What is missing from my side in the below expression.

in_Config(“OutputFilePath”).ToString+“SO_Folder”+““+now.Date.ToString(“dd-MMM-yyyy”)+”"+in_Config(“OutputFileName”).ToString+"”+System.DateTime.Now.ToString(“dd-MM-yyyy hh:mm:ss”)+“.xlsx”


Hi @marina.dutta

You have given the wrong Path in the Write range workbook activity. Try the below expression,

in_Config("OutputFilePath").toString+ "\SO_Foler_"+ DateTime.now.toString("dd-MM-yyyy")+ "\"+ in_Config("OutputFileName").toString+ DateTime.Now.toString("dd-MM-yyyy hh:mm:ss")+ ".xlsx"

Hope it helps!!

1 Like

Hi @marina.dutta

in_Config("OutputFilePath").ToString + "SO_Folder_" + now.Date.ToString("dd-MMM-yyyy") + "\" + in_Config("OutputFileName").ToString + "_" + System.DateTime.Now.ToString("dd-MM-yyyy_hh-mm-ss") + ".xlsx"

1 Like

@marina.dutta,

This should work:

in_Config("OutputFilePath").ToString + "\SO_Folder_" + now.Date.ToString("dd-MMM-yyyy") + "\" + in_Config("OutputFileName").ToString + "_" + System.DateTime.Now.ToString("dd-MM-yyyy_hh-mm-ss") + ".xlsx"

What you were missing?

  1. \ was missing between OutputFilepath and SO_Folder
  2. The file name dd-MM-yyyy hh:mm:ss should not contain special character : as it’s not allowed by Operating System. I would suggest to use - or _ as value separator.

Thanks,
Ashok :slight_smile:

1 Like

@ashokkarale @pravallikapaluri

Thank You . The error was mainly due to The file name dd-MM-yyyy hh:mm:ss should not contain special character :.

\ was there in the Output file path in Config sheet

1 Like

@marina.dutta
you’re Welcome
Happy Automation

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