error : Invalid Procedure call, Run time Error5 With acad.ActiveDocument For cntr = 0 To .Layouts.Count - 1 If .Layouts(cntr).Name = "Layout1" Or .Layouts(cntr).Name = "Layout1" Then .Layouts(cntr).Delete End If Next cntr End With I know what the problem is: cntr exceeds the range. I have 5 layouts, Ideally for loop should not be executed when cntr is 5 (it should stop after 4) but it DOES. I dont understand why, Am doing some basic thing wrong ? TIA irfan