In my VBA program for excel; I have a function called "ParamCheck" which get four "double" variables, checks them and returns a message as "string".
Function ParamCheck(airSpeed As Double, FCUvalue As Double, _
altitude As Double, terrainElevation As Double) As String
If airSpeed < MIN_CONTROL_SPEED Then
'check if airspeed is less than 119 ft/min or not
ParamCheck = "Airspeed is less than minimum control speed"
ElseIf FCUvalue > FCU_VALUE_LIMIT Then
'check if FCU value if greater than 10 or not
ParamCheck = "FCU value is greater than limit"
ElseIf FCUvalue < 0 Then
'check if FCU vlaue is negative or not
ParamCheck = "FCU value is negative"
ElseIf altitude <= terrainElevation Then
'check if altitude is greater that terrain of elevation or not
ParamCheck = "Altitude is less than terrain elevation"
Else
'if all the parameters are valid print a "Valid" message
ParamCheck = PARAMS_OK
End If
End Function
and now I need to call this function in my sub program. Here is the code
Dim checkParam As String ' result of validity check of parameters
Set checkParam = ParamCheck(speedAir, valueFCU, aboveSea, elevationTerrain)
when running it gives me this error "object required" and highlights "checkParam"