Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
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?

  • v-bofeng-msft Profile Picture
    on at
    Re: Flow Failing (Uses an Excel spreadsheet on SharePoing and a Script)

    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

  • hdhillon Profile Picture
    on at
    Re: Flow Failing (Uses an Excel spreadsheet on SharePoing and a Script)

    Bof,  

     

    Thank you for your response,

    What can I use in its place in the script?

  • v-bofeng-msft Profile Picture
    on at
    Re: Flow Failing (Uses an Excel spreadsheet on SharePoing and a Script)

    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

     

     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492