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 / Office Scripts - Range...
Power Automate
Unanswered

Office Scripts - Range delete: This won't work because it would move cells in a table on your worksheet.

(0) ShareShare
ReportReport
Posted on by 920 Super User 2024 Season 1

Hi,

 

Trying to run a script through power automate. I am getting the error on this -  Table.getRangeBetweenHeaderAndTotal().delete(0);

 

function main(workbook: ExcelScript.Workbook) {
    let Table = workbook.getTable("Table_query");
    let rowcount = Table.getRowCount();

 

    Table.getAutoFilter().remove();
    Table.getRangeBetweenHeaderAndTotal().delete(0);
}
 
where am I going wrong?
Categories:
I have the same question (0)
  • takolota1 Profile Picture
    4,974 Moderator on at

    @wonka1234 

    Can you use the table.deleterowsat() function?

     

    That’s what I did at the end of the Excel batch delete script here to remove the last blank row from a table: https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/Excel-Batch-Delete/td-p/1634375

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 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard