BASIC runtime error. '380' Incorrect property value with VBAsupport 1

I get BASIC runtime error. ‘380’ Incorrect property value when a simple spreadsheet calls this function in an xls spreadsheet (using LO 4.2.5.2 on Win7 Home Prem)

Rem Attribute VBA_ModuleType=VBAModule
Option VBASupport 1
Option Explicit


Global Const DAYS_PER_YEAR As Double = 365.25
Global Const MONTHS_PER_YEAR As Double = 12#


Public Function getCompound(initValue As Double, initDate As Date, finalDate As Date, intRate As Double) As Double
    Dim adjPeriod As Double
    adjPeriod = (finalDate - initDate) / DAYS_PER_YEAR
    getCompound = initValue * (1 + intRate) ^ adjPeriod
End Function

The macro works if I change VBASupport to 0 but the VBASupport line is added by LO and it is impractical to expect users to change code every time they open a Spreadsheet.

What is it actually objecting to?

The same spreadsheet works fine in OO 4.1.0 with Option VBASupport 1

I reported the problem on bugzilla https://bugs.freedesktop.org/show_bug.cgi?id=81003 and received a workaround solution to remove the AS DATE from the function definition

e.g.Public Function getCompound(initValue As Double, initDate, finalDate, intRate As Double) As Double

This solves my problem and hopefully will help anyone else who sees the same error in similar circumstance