I'm going to try to lay out this issue in as much detail as possible. Apparently I can't post images, as I am a New Member...So I will try to describe my situation as good as I possibly can.
So, I am working with a custom class called "Shifts". I have this class declared and set up in a Class Module in VBA. I declare an instance of the "Shifts" class inside a normal Module and call it "Shift".
Dim Shift As New Shifts
My "Shifts" class has 4 variables (String Arrays):
Private ShiftMembers() As String
Private ShiftCallSigns() As String
Private ShiftAssignments() As String
Private ShiftStatuses() As String
I have written a Sub within the class called "Clear" to clear the data in these variables (via ReDim):
Public Sub Clear()
ReDim ShiftMembers(-1) As String
ReDim ShiftCallSigns(-1) As String
ReDim ShiftAssignments(-1) As String
ReDim ShiftStatuses(-1) As String
End Sub
Now, when I call the Clear Sub of the "Shifts" class (declared as "Shift"):
Shift.Clear 'This is called from within the Module.
i get Subscript out of range (Error 9). My class is declared at the very top of the module, outside of any methods or functions. The Clear() sub within my class is declared Public. I don't understand why I can't seem to access my Clear Sub properly.
Any help would be greatly appreciated!
-Rob