Using LibreOffice Basic with AECOsim Building Designer


 Product(s):AECOsim Building Designer
 Version(s):08.11.09.866
 Environment:N/A
 Area:General
 Subarea:N/A

Problem

If I open “BuildingDesigner.xls” with LibreOffice Basic I get the following error message:

"If outside of a procedure is invalid”

Why am I seeing this error message?

Solution

The error message from the screenshot shows how “LibreOffice Basic” is not compatible with the VBA even though the syntax of the VBA code is correct.  The conditional code:

#If VBA7 Then

‘..

#Else

‘..

#End If

It is used by MicroStation CONNECT Edition to recognize which version of VBA should be called; e.g.,VBA 7 is used with MicroStation CONNECT Edition and supports 32 and 64 Bit, while VBA 6 is used with MicroStation V8i and supports 32 bit only.

So LibreOffice Basic does not allow this conditional declaration because it is not completely compatible with VBA, which is how it is required in MicroStation and/or Microsoft Office.

As a workaround, the error message could be avoided by creating 2 different VBA files for each case, but there is no guarantee that it will work correctly in all areas.

From the MicroStation CONNECT Edition Readme, the VBA components are required as described here:

https://docs.bentley.com/LiveContent/content/en/MicroStation%20ReadMe-v6/GUID-637B20A8-F57B-4FD0-9B4E-628574844438

Note: Since LibreOffice Basic is not certified to be used with MicroStation, it is also not certified to be used with AECOsim Building Designer.