【发布时间】:2017-11-24 15:21:51
【问题描述】:
在 VBA Excel 中,我第二次运行代码时出现自动化错误。 如下:
Sheets("Panel Resumen").Select
Rows("55:69").Select
Selection.Copy
Rows("55:55").Select
Selection.Insert Shift:=xlDown
Range("D25").Select
Application.CutCopyMode = False
并且它触发了行中的错误
Selection.Insert Shift:=xlDown
我研究并找到了这个链接https://support.microsoft.com/en-us/help/178510/excel-automation-fails-second-time-code-runs 但我不知道哪个是我未能调用的对象
【问题讨论】:
-
请参阅how to avoid Select,这可能会解决问题。
标签: vba excel automation runtime-error