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 / 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
    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
    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

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