Protected sheets gets unprotected upon CopyFile

Hi, I’m using UIPath Studio to create a routine to copy a template file into files with different names based on a list of names. e.g. supervisor_template.xlsx CopyFile to Alan.xlsx.

In my original template file, I have protected sheets which only allow certain cells to be editable. However, I realise my destination files (i.e. Alan.xlsx) are not protected anymore. What’s even stranger was when I right click on any cells in Alan.xlsx, I cannot even select “Format Cells” option!

Appreciate if someone can tell me what happened. I looked at the CopyFile parameters but there’s just nothing I could tweak. Is there a way to copy a file and retain it’s protected sheets/cells?

Hi all, after a bit of investigation, I realise the CopyFile function RETAINS the protected level. However, when I invoke the Write function, the entire file immediately loses the protected status.

Is there any other function that I can use instead of Write to assign a value into a cell without disrupting the file’s protected status?