So I have a breakpoint set before the function returns the value. Everything seems fine, however the cell I'm passing to ("=GetStock_VolumeHighValue()") gives me "A value used in the formula is of the wrong datatype." error.
Am I missing something really obvious here?
I've tried returning the value as an integer to no avail...
Any help would be really appreciated.
Cheers
Am I missing something really obvious here?
Code:
Option Explicit
'%
Enum StockVolume_HighLimit
Opening = 50
MidDay = 100
BeforeClosing = 150
AfterHours = 200
End Enum
Public Function GetStock_VolumeHighValue() As StockVolume_HighLimit
Dim result As StockVolume_HighLimit
Select Case GetTrading_Session()
Case TradingSession.Active
result = StockVolume_HighLimit.BeforeClosing
Case TradingSession.Early
result = StockVolume_HighLimit.Opening
Case TradingSession.Afternoon
result = StockVolume_HighLimit.MidDay
Case Else
result = StockVolume_HighLimit.AfterHours
End Select
GetStock_VolumeHighValue = result
End Function
I've tried returning the value as an integer to no avail...
Any help would be really appreciated.
Cheers