I delcare an array of dates and assign it with a function that returns an array of dates. Then I want to pass the result to a sub which takes an array of dates as a parameter. However, I am getting a type mismatch error on this line
SetStartDate (WorkingDates)
Here is the smallest version of the error producing code.
Sub Button1_Click()
Dim DateArray() As Date
WorkingDates = GetWorkingDateList()
SetStartDate (WorkingDates)
End Sub
Function GetWorkingDateList() As Date()
Dim DateList(2) As Date
DateList(1) = Date
GetWorkingDateList = DateList
End Function
Sub SetStartDate(DateList() As Date)
MsgBox DateList(1)
End Sub
What have I done wrong?
Thanks!
Dave
Bookmarks