Option VBASupport Statement

Specifies that LibreOfficeDev Basic will support some VBA statements, functions and objects.

Sajoo Yaaddannoo

The support for VBA is not complete, but covers a large portion of the common usage patterns.


warning

This statement must be added before the executable program code in a module.


warning

When VBA support is enabled, LibreOfficeDev Basic function arguments and return values are the same as their VBA functions counterparts. When the support is disabled, LibreOfficeDev Basic functions may accept arguments and return values different of their VBA counterparts.


Syntax:

Option VBASupport {1|0}

Parameters:

1: Enable VBA support in LibreOfficeDev

0: Disable VBA support

Example:


Option VBASupport 1
Sub ExampleVBA
    Dim sVar As Single
    sVar = Worksheets("Sheet1").Range("A1")
    Print sVar
End Sub

VBA Properties

VBA support in LibreOfficeDev

CompatibilityMode() Function

CompatibilityMode() function is controlling runtime mode and affects all code executed after setting or resetting the mode.