Programatically design a form

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I'm familiar with vba but fairly new to vb6

I want to replicate an Excel vba userform to a vb6 form. The form is very
complex, as I'm forever redesigning it I build a new vba userforms from an
array of control types and their properties stored in an excel work***.
Something like this

myArray = Excel-Work***-Range.Value ' control types & properties
' my array is 1 base, 2 dim's

With ThisWorkbook.VBProject.VBComponents(sFormName).Designer
For i = 1 To UBound(myArray)
s = "Forms." & myArray (i, 1) & ".1" ' control classname
..Controls.Add (s)
..Controls(i - 1).Name = myArray (i, 2)
etc

I know how to get my array into vb, I also know I will need to change some
vba classnames (eg Forms.CommandButton.1" ) and property types to their vb6
equivalents.
However, and my question, how would I use this array it to design a vb6 form
that I can save.

TIA,
Peter T


.


Quantcast