web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Excel Run Script Flow ...
Power Automate
Unanswered

Excel Run Script Flow Doesn't Pause Protection

(1) ShareShare
ReportReport
Posted on by 2

Hello!

 

Whenever I run my office script manually from excel itself, the sheet protection is paused/resumed.

 

However, whenever the script runs on power Automate flow(Run a script), the protection doesn't get paused or resumed.

 

Please find the script below. I have the correct password in the script but have hidden it here:

 

 

 

function main(workbook: ExcelScript.Workbook) {
 let sheetNames = ["AUTOMATE WH", "AUTOMATE HP+"];
 sheetNames.forEach(sheetName => {
 let sheet = workbook.getWorksheet(sheetName);
 if (sheet) {
 sheet.getProtection().pauseProtection('*****')
 console.log(`Sheet "${sheetName}" protection paused.`);
 } else {
 console.log(`Sheet "${sheetName}" not found.`);
 }
 });
}

 

 

 



Thanks in advance for any help you can provide!

Categories:
I have the same question (0)
  • Homunculu Profile Picture
    3 on at

    Hi, I was having the same problem and I could not find out a way to make the pauseProtection and resumeProtection to work with Power Automate. Thus, I decided to use protect and unprotect, and it worked.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard