Share via

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

Microsoft 365 and Office | Development | Other
Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments

1 answer

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

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

    Was this answer helpful?

    0 comments No comments

Your answer

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