NeMeSiS1987
Erfahrenes Mitglied
Hallo,
bin schon am verzweifeln, aber wird wahrscheinlich wieder nur an einer Kleinigkeit liegen...
Habe die Klasse cOrder in einem Klassenmodul:
Nun will ich die Funktion fillObject() für ein Objekt aufrufen:
Es kommt bei a.fillObject(i) ein "Type mismatch"
Hab keine Ahnung warum das nicht geht
Danke für eure Hilfe!
bin schon am verzweifeln, aber wird wahrscheinlich wieder nur an einer Kleinigkeit liegen...
Habe die Klasse cOrder in einem Klassenmodul:
Code:
Option Explicit
Dim strOrderSect As String
Dim strPL As String
Public Property Get getPL() As String
getPL = strPL
End Property
Public Property Get getOrderSect() As String
getOrderSect = strOrderSect
End Property
Public Property Let setPL(ByVal sProductLine As String)
strPL = sProductLine
End Property
Public Function printOrder(ByVal iLine As Integer, wsSheet As Worksheet) As Boolean
With wsSheet
If IsEmpty(.Cells(iLine, 5)) Then
.Cells(iLine, 5).Value = strPL
printOrder = True
Else
printOrder = False
End If
End With
End Function
Public Function fillObject(ByVal iLine As Integer) As Boolean
With ThisWorkbook.Worksheets("Sheet1")
If .COLUMNS <> COLUMNS Then
fillObject = False
Else
strOrderSect = .Cells(iLine, 1).Value
fillObject = True
End If
End With
End Function
Nun will ich die Funktion fillObject() für ein Objekt aufrufen:
Code:
Dim a As cOrder
Dim i As Integer
...
Set a = New cOrder
If a.fillObject(i) Then MsgBox "ok"
...
Es kommt bei a.fillObject(i) ein "Type mismatch"
Hab keine Ahnung warum das nicht geht

Danke für eure Hilfe!