Apache OpenOffice (AOO) Bugzilla – Issue 126351
Basic : Incorrect Redim for an array of structure
Last modified: 2015-06-03 17:25:55 UTC
Run the following code in the IDE Set a breakpoint at or after the MsgBox and set a watch on variable props Sub Test Dim n As Long Dim props(2) As New com.sun.star.beans.PropertyValue n = 1 Redim props(n) As New com.sun.star.beans.PropertyValue msgBox Ubound(props()) End Sub MsgBox displays : 2 (should be 1) Watch displays : props(0) is a Null Object (should be a PropertyValue) Whatever the value of n, the array keeps the original dimension. Same problem with any other API structure. The bug seems very old. Workaround : use Preserve Redim preserve props(n) As New com.sun.star.beans.PropertyValue
Maybe a dup of issue 124154
(In reply to oooforum from comment #1) > Maybe a dup of issue 124154 No, it isn't.
.