Click here to Skip to main content
15,905,419 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I just tried to delete the first row of an excel file.I got the error
No overload for method 'Delete' takes '0' arguments on the following code line..
clsWorksheet.get_Range("A1", "A1").EntireRow.Delete();

Could you tell me what is this.
Posted

how you are trying to delete it, either through macro or some other language
 
Share this answer
 
As the error states there is no Delete method that takes no parameter.
The Delete[^] function expects a parameter which specifies how to shift cells to replace deleted cells.
In your case probably XlDeleteShiftDirection.xlShiftUp so try
C#
clsWorksheet.get_Range("A1", "A1").EntireRow.Delete(XlDeleteShiftDirection.xlShiftUp);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900