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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power Automate not run...
Power Automate
Unanswered

Power Automate not running recorder script in Excel

(0) ShareShare
ReportReport
Posted on by 6

Hello,

I want to create a flow through Power Automate that runs a script on a shared Excel file to refresh the conditional formatting for duplicate data in case a co-author cuts and delete my conditional formatting. The file is located in Teams (Business Teams account). I tried creating a schedule-based flow and adding a step that includes Excel Business/Run Script; however, Power Automate is not running the script (Although Power Automate tells me the script has ran). Please help! Thanks 🙂

Categories:
I have the same question (0)
  • Yutao Huang Profile Picture
    Microsoft Employee on at

    Hello @rudiaz ,

    Just to make sure I understand the situation correctly - I assume the Power Automate run history says the Run script action has finished successfully, right? Then how did you know the script actually hasn't run? Was it because the workbook didn't reflect the changes made by your script code?

     

    To troubleshoot the problem, you can try adding some console.log("...") statements throughout your script so you can tell how your script runs based on the logs. You can go to the Power Automate run history, expand the Run script action, and look into the Outputs box for the logs.

  • rudiaz Profile Picture
    6 on at

    Thanks for replying! Correct, the Power Automate run history says the Run script action has finished successfully. However, the workbook does not reflect the changes by re-applying the conditional formatting to the specified range. The script seems to be running fine, however, the conditional formatting is not getting re-applied. I tried recording a script for copying and pasting data and it worked fine, just not working with conditional formatting.

  • Yutao Huang Profile Picture
    Microsoft Employee on at

    Do you mind sharing your script and maybe some sample data if possible?

  • rudiaz Profile Picture
    6 on at

    Sure!Image.PNGimage 2.PNGimage 3.PNG

  • rudiaz Profile Picture
    6 on at

    The idea is to use the script to help me prevent duplicate entries. The script is to re-apply conditional formatting in case someone cuts and paste, deleting the conditional formatting from a particular cell. Thanks 🙂

  • Yutao Huang Profile Picture
    Microsoft Employee on at

    Thanks for sharing the details!

     

    I'm wondering if you can try replacing getActiveWorksheet() with getWorksheet("the_sheet_name"). Relative references may behave differently in Power Automate. You can find more details here: https://docs.microsoft.com/en-us/office/dev/scripts/testing/power-automate-troubleshooting#avoid-relative-references

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 60 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 54

#3
Expiscornovus Profile Picture

Expiscornovus 47 Most Valuable Professional

Last 30 days Overall leaderboard