elotromateo
New Member
- Joined
- May 19, 2010
- Messages
- 42
I have an interesting type mismatch error. I am using a UDF that needs inputs that are type Double. The inputs I am using are parts of arrays that have been defined as Variant. When I try converting the center part which is a subtraction of two arrays, the error occurs. If I get rid of the subtraction, the code works, but I need the subtraction and do not want to clutter up space by writing the code for another array that is so simple to write here. I have also tried converting them separately, but that does not work either. Does anyone know how to fix this?
Code:
Works:
ElseIf OAWeather(i, 1) > embedpsych("EN", "DB", [COLOR="red"]CDbl(DATSP(i, 1))[/COLOR], "HR", CDbl(DAHR(i, 1))) Then
Doesn't work:
ElseIf OAWeather(i, 1) > embedpsych("EN", "DB", [COLOR="Red"]CDbl(DATSP(i, 1) - SFHeat(i, 1))[/COLOR], "HR", CDbl(DAHR(i, 1))) Then