Excel错误400与ActiveCell.EntireRow.Insert

我遇到了一个模糊的“400”错误与一个微不足道的视觉基本脚本。 我评论了一切,只留下我的方法单行: ActiveCell.EntireRow.Insert

这里“完整”(剥离)的方法(这是键入Ctrl + Shift + n):

Sub NewUserStory() ' ' NewUserStory Macro ' Creates a new empty user story with pasted formulas for remaining work, and cumulative planning information ' ' Keyboard Shortcut: Ctrl+Shift+N ' ActiveCell.EntireRow.Insert ' Insert a new row above selected row End Sub 

如果我select了任何单元格,并按下macros,则debugging器将停在我的断点上。 当我进入方法时,我立即得到错误“400”popup。 我100%肯定没有其他方法被执行。

我一直在谷歌这最后2个小时,但没有解决这个问题。 对不起,跛脚的问题,但我需要为我的工作血腥的macros:)。

提前谢谢了!

PS:如果有人可以为ActiveCell.EntireRow.Insert提供一个替代品,我当然也是耳熟能详!

可能你有在你试图插入行的工作表的最后一行的内容?

这会导致错误。