I changed the code for ArrayFill() proc.:
[vba]Private Sub ArrayFill()
Dim r As Range
Set DataXCollection = New Collection
Set r = Worksheets("SheetX").Range("A1")
Do Until r = ""
'make sure we create a new instance of your custom type on every iteration
Set dx = New DataX
dx.CodeX = r.Text
dx.PriceX = r.Offset(1).Value
dx.ColorX = Application.Transpose(Range(r.Offset(, 1), r.Offset(, 1).End(xlRight)))
dx.SizeX = Application.Transpose(Range(r.Offset(1, 1), r.Offset(1, 1).End(xlRight)))
Product.AddItem dx.CodeX
'add this reference of an instance of your custom type to
'to the DataXCollection collection for future use
'use the product code as the key
DataXCollection.Add dx, dx.CodeX ' dx.CodeX -key)
Set r = r.Offset(2)
Loop
Product.Text = "Product input"
End Sub[/vba] When i click on a button to start program:
With [vba]Private Sub CommandButton1_Click()Run-time error '1004':
Application-defined or object-defined error
OrderForm.Show
End Sub[/vba] OrderForm.Show yellow marked ???
What OrderForm.Show has to do with it ???