VB6 Add-in: difference in behaviour of arrays

Hi all

I have this simple array:

Dim SheetNames() As String

SheetNames = swDrawing.GetSheetNames

This works fine as a macro but it refuses to compile into an add-in, giving the error: "Compile error: Can't assign to array"

Can anyone advise? The error also occurs if the array is dimensioned in advance.

Thanks

SolidworksApi macros