1

I have created Template excel file for my colleagues to upload their rosters each month, they do this by uploading the roster to Microsoft forms, then I manage to rename the excel sheets and move them to a new folder using power automate.

While the process is good and convenient, the Excel Template is protected with a password, and each time I am working with these large files I need to manually opens each one and then enter the password so I can work on them.

I am just asking if there is a way in power automate unprotected the sheet before move them to the final folder automatically since I have the password.

Searching google on this, and looking for post, but there was no answer near my question.

2 Answers 2

1

Yep, use Office Scripts.

Never used Office Scripts before? If so, check out these links.

https://learn.microsoft.com/en-us/office/dev/scripts/overview/excel

https://support.microsoft.com/en-us/office/introduction-to-office-scripts-in-excel-9fbe283d-adb8-4f13-a75b-a81c6baf163a

This is a basic script which shows how to unprotect at the workbook level and the worksheet level respectively.

function main(workbook: ExcelScript.Workbook, password: string) {
    workbook.getProtection().unprotect(password);

    workbook.getWorksheets().forEach(sheet => {
        sheet.getProtection().unprotect(password);
    });
}

You're then able to call that script over any book from PowerAutomate using the Run script operation from the Excel online (business or OneDrive).

Run script

Sign up to request clarification or add additional context in comments.

Comments

0

after run the script for protected. There is nothing change in the workbook. workbook still can be open

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.