Rijnsent
Well-known Member
- Joined
- Oct 17, 2005
- Messages
- 1,460
- Office Version
- 365
- Platform
- Windows
I have a bit of code that has been working fine for years, but now suddenly get feedback from some users that my error catching shows them "Insert method of range class failed". The simplified version of my code is the following:
As I wrote, it seems like it works fine for almost all users, but recently some bumped into this issue. It seems like the .Insert line sometimes fails, but I can't see what might cause it, as it does always work on the 2 test-laptops where me and my colleague work on. Does anyone have a pointer?
VBA Code:
Sub AddLine()
On Error GoTo ErrCatch
Set Sht = Worksheets("SHEET_A")
Sht.Unprotect Password:="PWD"
Rw = ActiveCell.Row
Set FirstCl = Sht.Cells(Rw, 1)
FirstCl.Rows("1:1").EntireRow.Copy
FirstCl.Rows("1:1").EntireRow.Insert Shift:=xlDown
Exit Sub
ErrCatch:
Debug.Print Err.source, Err.Description
End Sub