“Automation Error: Object Invoked has disconnected from its clients”

前端 未结 4 1953
鱼传尺愫
鱼传尺愫 2021-01-13 22:20

I figured out what Nick was suggesting, and the following is the error number & description that I\'m getting:

\'-2147417848 (80010108)\' Automation

4条回答
  •  伪装坚强ぢ
    2021-01-13 22:23

    Make sure your sheet is not protected with cells locked while doing insert. This could be one of the reason why the code will fail. This code was working for me on one folder, but when I copied the excel macro file to another folder I started getting this error. Since it is only for formatting, I avoided using the below codes altogether and did formatting the usual way and not copying from above rows. Note that in first code, entire row gets selected and if you have protected cells, it could lead to failure.
    'Rows(r + 3 & ":" & r + 3).Select 'Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove

提交回复
热议问题