Hello, againI have posted earlier my code to creating user form at runtime.
Hello,
Here is my code to create user form at runtime
Sub cbCreateUserForm()Dim vbeditor As VBESet vbeditor = Application.VBEDim stform As VBComponentSet stform = vbeditor.ActiveVBProject.VBComponents.Add(vbext_ct_MSForm) 'work create Form with standart name UserForm1, UserForm2 etc.stform.Name = "BhBpForm"stform.Properties("Caption") = "BhBpCaption"stform.Properties("BackColor") = vbRed
End Sub
Now i have one other question When starting first time, code is working well and the form BhBpForm was created
In Project Explorer i see just created BhBpFormThen I delete BhBpForm from Project explorerAfter deleting code above not working.If i change name of form to create to BhBpForm1 code work again and BhBpForm1 was created.
Sub cbCreateUserForm()Dim vbeditor As VBESet vbeditor = Application.VBEDim stform As VBComponentSet stform = vbeditor.ActiveVBProject.VBComponents.Add(vbext_ct_MSForm) 'work create Form with standart name UserForm1, UserForm2 etc.stform.Name = "BhBpForm1"stform.Properties("Caption") = "BhBpCaption"stform.Properties("BackColor") = vbRed
Rememmber - BhBpForm was deleted.
I try to create BhBpForm again with code above, but he retturn me error.If I restart CorelDRAW i can create BhBpForm againI think, that restarting Corel clears memory from many things.I ask for method to reset CoreDRAW with VBA code without restarting CorelGreetings!
Maybe some BYTECODE cache, but unlikely since VBA uses JIT. Just one correction, your code generates "form" in DESIGN TIME and not RUNTIME
Thank You for this answer!What is difference between DESIGN TIME and RUN TIME coding? My code generates user form. I think this is RUN TIME creating of user form. I think DESIGN TIME is when we use Visual Basic Editor for coding. Please, explain!