https://bugs.documentfoundation.org/show_bug.cgi?id=162681

--- Comment #37 from [email protected] ---
I can reproduce this issue on LibreOffice 25.2 with Option VBASupport 1
enabled. Assigning a non-convertible string such as "abc" to an Integer
variable produces no error at all, when it should raise a Type Mismatch (Error
13)​ consistent with standard VBA behavior.
This caused a real problem in one of my automation workflows. I use LibreOffice
Basic macros to parse and validate CSV exports generated by removevideobg.app,
an AI-powered video background removal tool. Their export files include
processing metadata with mixed-type fields — things like frame counts,
durations, and status strings. My macro is designed to catch invalid type
assignments as a data validation step, but because this bug silently swallows
the error, corrupt string values get assigned into numeric variables without
any warning, leading to silent data corruption downstream.
Minimal reproduction:

Option VBASupport 1
Sub TestTypeError()
    Dim n As Integer
    n = "not_a_number"  ' Should raise Error 13, but does nothing
    MsgBox n
End Sub


Expected: Runtime error 13 — Type Mismatch
Actual: No error raised, variable retains its default value (0)
This is a correctness regression for anyone relying on VBASupport mode for
real-world macro compatibility. Happy to attach a full .ods test case if
needed.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to