Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() The following code could only run correctly once after the workbook's open. I could not understand why we couldn't name a form as the early one we've deleted before. IF we change vbext_ct_MSForm to vbext_ct_StdModule, all goes well. What's the reason of it? Is it caused by form's designer object? Thanks in advance. Sub AddAndRenameVBComponent() Dim oProjForm As VBComponent Dim oProj As VBProject Const sFormName As String = "FormTest" Set oProj = ThisWorkbook.VBProject On Error Resume Next oProj.VBComponents.Remove oProj.VBComponents(sFormName) On Error GoTo 0 Set oProjForm = oProj.VBComponents.Add(vbext_ct_MSForm) With oProjForm .Name = "Test" End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Tab Naming | Excel Worksheet Functions | |||
Saving MSForm.Control (s) created at Runtime? | Excel Programming | |||
Creating an MSForm based on a table | Excel Programming | |||
MSForm 1 - Initial placement of form | Excel Programming | |||
MSForm 2 - Creating labels and text boxes at run time | Excel Programming |