Workbook Password Protect

Hello everyone,

I am trying to protect my excel workbook, I don’t want to use any third party activity. could somebody help me get resolve it through some uipath activity or thru invoke code.

thanks

Use “InvokeVBA” activity for this task.
Add this simple code to your Excel file, and then run code from UiPath.

Sub ProtectBook()
ThisWorkbook.Protect Password:=“YourPassword”, Structure:=True, Windows:=True
End Sub

1 Like