Read CSV: Access to the path .... is denied

Hello,
I’m working on level 3 assignment 2.

After successfully creating a csv file (monthly report), the program must read it in order to merge it in a datatable.

I use read csv as required but I found a problem due to some file attribute.

In my company, there is a file attribute set by default to the company name. I can change it in the file explorer to “personal”.

The csv file is created with the attribute set to the default value (company name). If I set a breakpoint on read csv and change the attribute to “personal”, read csv works with no problem.

Leaving the default attribute, read csv fails with access denied.

Is there any way to set a file attribute from UiPath?

Thanks in advance for your help.

Hi,
use file.setAttribute method and this will help you.

Please follow the below link for more details.


Regards,
Pavan H

Thanks.
I can get attributes with an assign activity, for example File.GetAttributes(ReportFilePath) on the right side.
But what activity can handle in UiPath File.SetAttributes?

I found that the encrypt attribute needs to be removed.
So I added a powershell command inside invoke powershell

“(Get-Item -Force -LiteralPath $in_file).Decrypt()”
in_file is declared in PowerShellVariables
I get an error
Invoke Power Shell: Cannot bind argument to parameter ‘LiteralPath’ because it is null.

The command works with a hard coded file name.