Hello,

I currently have what will amount to be 300 controls that need new names and in some case captions. They follow an easy to loop through naming convention so I am trying to write a simple macro to save me a few hours worth of clicking and typing. I am getting an error of can not set the name property. Can not set property at runtime. I am wondering if this means I am out of luck and get to spend the rest of the day clicking around or if my code below just has errors.

Sub addbox()
    
    For i = 1 To 20
        With FSRForm.PMFrame
            .Controls("Label" & 396 + i).Name = "EmployeePM" & 30 + i
            .Controls("Label" & 396 + i).Caption = 30 + i
            
            .Controls("Combobox" & i).Name = "PMEmployeePT" & 30 + i
            .Controls("ToggleButton" & 1 + i).Name = "ShiftPM" & 30 + i
        End With
    
    Next i
    
                
        
End Sub
Thanks