I wrote a subroutine and was using the following code without any error in that sub routine.
Only relevant code:
Dim CandleEndTimes() as Date
NoOfCndlInDay = 5
ReDim Preserve CandleEndTimes(NoOfCndlInDay)
CandleEndTimes = Array(#10:30:00 AM#, #12:00:00 PM#, #1:30:00 PM#, #3:00:00 PM#, #3:30:00 PM#)
Then to make this subroutine handle more than one cases, I removed the statement assigning values to the array CandleEndTimes
and defined it as a parameter as under
Sub CustomCandles(UseOnBookName As String, UseOnSheetName As String, NoOfCndlInDay As Integer, CandleEndTimes() As Date)
The code of the subroutine used to call the above sub:
Sub callingcust()
Dim Min90CandleEndTimes() As Date
ReDim Preserve Min90CandleEndTimes(5)
Min90CandleEndTimes = Array(#10:30:00 AM#, #12:00:00 PM#, #1:30:00 PM#, #3:00:00 PM#, #3:30:00 PM#)
End Sub
While debugging the code at the statement used to assign values i get a error 13
Can anyone see anything wrong with the above code. In case you feel that the info is not sufficient do let me know what else I need to share.
Kindly help!