UserForm error: Method 'Properties' of object '_VBComponent' failed
问题 I want to edit my UserForm object in VBE with code. When I use the following, I get an error as in post title: Sub myTest() ThisWorkbook.VBProject.VBComponents("UserForm1").Properties("Caption") = "myCaption" End Sub I tried changing "Caption" to "caption", the same error. Also this error happens when I try to set Width or Height properties, not always at first time, but when I run the code again to resize. Edit 1: "Trust access to the VBA project object model" in macro settings is enabled.