On the line below, I'm getting the error "Object variable or with block, variable not set" (Error 91).
Set cmd = ActiveWorkbook.VBProject.VBComponents("UserForm1").Designer.Controls.Add("Forms.CommandButton.1", "cmdTst")
Where cmd is defined as
Dim cmd As MSForms.CommandButton
![The watch window for reference (Applied Break on the error line and on Pressing F8)](https://i.stack.imgur.com/Jq54C.png)