Hi,

I have VBA code like this:

If Workbooks("DTX.xlsb").Worksheets("Ref1").Range("O2").Value <> 0 Then
Call Log_High_Low_DTX1
End If
The formula in O2 is: "=IFERROR(IF(OR(M2="OFF",L2<=N2),0,L2),0)" (the iferror statement is to make sure it returns no errors). Usually this code runs fine but sometimes it crashes on the first row giving the error in the picture attached. error.jpg If I press "debug" the popup will come again and if I choose "end" Excel crashes (quits).

I don't see any strange value in O2 when it happens. I'm 100% sure there was a 0 in there the last time I saw the vba error. I don't understand why it's crashing as the entire code is:

    If Workbooks("DTX.xlsb").Worksheets("Ref1").Range("O2").Value <> 0 Then
    Call Log_High_Low_DTX1
    End If

    If Workbooks("DTX.xlsb").Worksheets("Ref1").Range("O3").Value <> 0 Then
    Call Cross_Signal_Hedge_Ref1
    End If
    
    If Workbooks("DTX.xlsb").Worksheets("Ref1").Range("O4").Value <> 0 Then
    Call Cross_Movers_DTX1
    End If
Which works fine and it's duplicated in a different duplicate tab as well which also works fine.

Any help would be appreciated.