Best method to password protect existing excel (.xlsx) files

Hi there,

Can anyone share their preferred/considered best method to password protect existing excel (.xlsx) files?

I thought there would be a UiPath official package for doing this but it appears as if there is not.


Welcome to the UiPath Community @Marcus_Loveland!

You can do that using vb script, below link shows how to create a vb script and then you can run that script using Invoke VBA activity

Thanks so much for your response. I had starting looking at that method but then realised that my documents were .xlsx and as such I could not place a macro in the file.

I am trying to decide where to go from here. If I can start them out as .xlsm files and once password protected then save then again as .xlsx

Just having a think on my side on the best method. Once again thanks for your input.

have a look on this activity

Thanks Peter. Appreciate it and I will take a look at that.

Out of interest and I know this may be hard to answer and it is like all 3rd party pieces of code but are these activities safe to use or are they security risks to an organisation? I know it is hard to answer.

I also wanted to ask and again you may not no the answer but with activities like this is one able to see the actual source code somewhere - i.e. many C# “plugins” have the code on GitHub.

Sorry for all the questions.

we do trust @balupad14 but let him answer as he is the author

1 Like

Thanks Peter. Let’s see what the man has to say! (:wink:

Credit where credit is due the package works like a charm. Well played @balupad14 - now let’s hope my infrastructure is still 100% secure!

Marking both these responses as solutions but the SetPassword one is easier to implement. So going with that one.

1 Like

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