What I missed. I already added the MS VBA Extensibility 5.3 on a VBA Reference. but still got an error. Please Help.
Line1: Dim objForm as object
Line2: Set objForm = ThisWorkbook.VBProject.VBComponents("UserForm1").Designer
Line3: Set Butn = objForm.Controls.Add("Forms.CommandButton.1")
The error is on Line3, "Runtime Error '91': Object Variable or With block variable not set"
Line1: Dim objForm as object
Line2: Set objForm = ThisWorkbook.VBProject.VBComponents("UserForm1").Designer
Line3: Set Butn = objForm.Controls.Add("Forms.CommandButton.1")
The error is on Line3, "Runtime Error '91': Object Variable or With block variable not set"