尝试从Excel文件中删除行时发生错误. [英] Error occured when tried to delete a row from excel file.

查看:400
本文介绍了尝试从Excel文件中删除行时发生错误.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我只是尝试删除excel文件的第一行.出现错误
在下面的代码行中,方法"Delete"的重载没有接受"0"参数.

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.

推荐答案

如何通过宏或其他某种语言删除它
how you are trying to delete it, either through macro or some other language


由于错误状态,没有没有参数的Delete方法.
Delete [
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
clsWorksheet.get_Range("A1", "A1").EntireRow.Delete(XlDeleteShiftDirection.xlShiftUp);


这篇关于尝试从Excel文件中删除行时发生错误.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆