Excelにブックの保護をかけたい

お世話になっております。
既存のExcelファイルに、ブックの保護パスワードをかけたいです。
どうしたらよろしいでしょうか?
モダンデザインの[Excelファイルを使用]のプロパティにある[パスワード]と[編集パスワード]に記載しても、すでにセットされているパスワードを解除するだけで、新たにセットすることはできませんでした。

Hi @FSP

To set the password for an excel file, you can use invoke vba activity. Look at this code snippet;

Sub SetPassword()
Dim strPassword As String
strPassword = “yourpassword”
ActiveWorkbook.Password = strPassword
End Sub

Also note that if your file is already password protected, then you will need to provide that password in your UiPath workflow before you can set a new one.

Hope this helps,
Best Regards.

2 Likes

@arjunshenoy
Thank you!

1 Like

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