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 / Flow Failing (Uses an ...
Power Automate
Unanswered

Flow Failing (Uses an Excel spreadsheet on SharePoing and a Script)

(0) ShareShare
ReportReport
Posted on by

All I have created the following Flow to unfilter a spreadsheet, unhide columns and also select a cell. This is scheduled and runs each midnight, everyday

 

 

However im getting the following error: 

 

hdhillon_0-1676303137956.png

 

Script Code is below:

 

function main(workbook: ExcelScript.Workbook) {
  // ECPT (People) Tab
  let dataSource = workbook.getTable("DataSource");
    // Clear auto filter on table dataSource
  dataSource.getAutoFilter().clearCriteria();
  let people = workbook.getWorksheet("ECPT (People)");
    // Set visibility of column(s)  on people to true 
  people.getRange("A:AW").setColumnHidden(false);
  people.getCell(3, 0).select();

 

  // Dispositioned Roles Tab
  let Dispositioned_Roles = workbook.getTable("Dispositioned_SupplyChain");
    // Clear auto filter on table dataSource_Process
  Dispositioned_Roles.getAutoFilter().clearCriteria();
  let dispositioned1 = workbook.getWorksheet("Dispositioned Roles (POST ACE)");
    // Set visibility of column(s)  on process to true 
  dispositioned1.getRange("A:Z").setColumnHidden(false);
  dispositioned1.getCell(2, 1).select();

 

  // Eastern PServ Tab
  let PServ = workbook.getTable("PServ_Contractor");
    // Clear auto filter on table dataSource_Process
  PServ.getAutoFilter().clearCriteria();
  let Pserv1 = workbook.getWorksheet("Eastern PServ");
    // Set visibility of column(s)  on process to true 
  Pserv1.getRange("A:Z").setColumnHidden(false);
  Pserv1.getCell(1, 0).select();

 

  // ECPT (Process) Tab
  let dataSource_Process = workbook.getTable("DataSource_Process");
  // Clear auto filter on table dataSource_Process
  dataSource_Process.getAutoFilter().clearCriteria();
  let people2 = workbook.getWorksheet("ECPT (Process)");
  // Set visibility of column(s)  on process to true 
  people2.getRange("A:CU").setColumnHidden(false);
  people2.getCell(3, 0).select();
}

 

How do I get the get.cell(x,x).select to work?

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @hdhillon ,

     

    The point is that the select methods will throw an error and fail when called from a script in a Power Automate flow.

     

    vbofengmsft_0-1676338254703.png

    https://learn.microsoft.com/en-us/office/dev/scripts/testing/power-automate-troubleshooting#script-methods-that-fail-when-run-in-power-automate-flows

     

     

    vbofengmsft_1-1676338355741.png

     

    Best Regards,

    Bof

     

     

  • hdhillon Profile Picture
    on at

    Bof,  

     

    Thank you for your response,

    What can I use in its place in the script?

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @hdhillon ,

     

    I am not aware of any other alternative currently , cause this is a known limitation.

     

    In addition, If you want professional guidance on Office Script coding, I suggest you ask questions on Microsoft Q&A.

     

    https://learn.microsoft.com/en-us/answers/tags/9/m365

     

    Best Regards,

    Bof

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 274 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 175

#3
Haque Profile Picture

Haque 166

Last 30 days Overall leaderboard