View Single Post
  #1   Report Post  
davidman davidman is offline
Junior Member
 
Posts: 8
Default Custom class, Stack overflow error

Hi

I have written a class module but when I try to load more than one variable Excel gives me a type 28 error, Google says that it is a memory issue but if it won't even load two strings there must be an error with my code, can someone point out where I have made the mistake please?

My class module is:

Code:
Private pEmpID As String
Private pStartDate As Date
Private pEndDate As Date
Private pStatus As String
Private pHolType As String
Private pShift As String

Public Property Let strEmpID(EmpID As String)
pEmpID = EmpID
End Property

Public Property Get strEmpID() As String
strEmpID = pEmpID
End Property

Public Property Let strStartDate(StartDate As Date)
strStartDate = StartDate
End Property

Public Property Get strStartDate() As Date
pStartDate = strStartDate
End Property

Public Property Let strEndDate(EndDate As Date)
strEndDate = EndDate
End Property

Public Property Get strEndDate() As Date
pEndDate = strEndDate
End Property

Public Property Let strStatus(Status As String)
strStatus = Status
End Property

Public Property Get strStatus() As String
pStatus = strStatus
End Property

Public Property Let strHolType(HolType As String)
strHolType = HolType
End Property

Public Property Get strHolType() As String
pHolType = strHolType
End Property

Public Property Let strShift(Shift As String)
strShift = Shift
End Property

Public Property Get strShift() As String
pShift = strShift
End Property
And my Sub in a normal module is
Code:
Sub Refusetest()
    Dim iHol As clsHoliday
    Set iHol = New clsHoliday
    'With Sheets("MyTime")
        iHol.strEmpID = "EmpID1"
        iHol.strShift = "Shift1"
        'iHol.strStartDate = #1/21/2015#
        'iHol.strEndDate = #1/28/2015#
        'iHol.strHolType = "Type1"
    'End With
    MsgBox iHol.strEmpID
End Sub