LO Basic Macro equivalent to MS Excel VBA line: "If Err.Number = 6 Then OutOfBounds = True"

Hi all,

I am trying to translate a MS Excel VBA Macro into one for LO Calc, and there is a line at the beginning of the Sub that reads:

On Error GoTo OverflowTest

Then at the end of the Sub, there is:

Exit Sub

OverflowTest:
    If Err.Number = 6 Then OutOfBounds = True
End Sub

Naturally, LO doesn’t like this, so what would be the equivalent?

Thanks in Advance

Looks like the error code number is the same but the syntax is slightly different. Try

OverflowTest:
    If err = 6 then OutOfBounds = true
end sub

Ah.Thank you. :slight_smile: I hope the error code is the same. There seems to be a lot the same between Excel and Calc, which is nice.

Thanks again.