How to delete all rows of a table skipping the first row with Excel Script without fail by this error, Table deleteRowsAt: The argument is invalid or missing or has an incorrect format.

García, Saúl Enrique 0 Reputation points
2024-11-27T17:23:16.9433333+00:00

Hello evreyone,

Could someone help me with this?

I'm trying to delete all rows of a table skipping the first row, because this table have formulas, and I don't want to delete the first row to keep the formulas.

When I run the script, it does what I want but no matter how I change the script it allways get the error:

Table deleteRowsAt: The argument is invalid or missing or has an incorrect format.

The issue, is that I need to use this script with power automate and it's known that a script with errors cause the flow breaks.

User's image

Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
2,018 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,069 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Viorel 118.5K Reputation points
    2024-11-27T18:20:55.5166667+00:00

    Try this: table2.deleteRowsAt( 1, rowCount2 - 1 ).

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.