I imported a VBA macro from Excel, but it won’t run properly in Calc. Here’s a section of the imported code:
Private Sub UserForm_Initialize()
Dim RngTags As Range, RngNames As Range, i As LongSet Rng1 = Sheets(“options”).Range(“options”)
With ComboBox1
.ColumnCount = 1
.Style = fmStyleDropDownList
.TextAlign = fmTextAlignLeft
.BoundColumn = 1For i = 1 To Rng1.Count
.AddItem Rng1(i).Value
.List(.ListCount - 1, 1) = Rng1(i).Value
Next iEnd With
End Sub
In Excel, this creates a dropdown list for the combo box by referencing a range [“options”] in a worksheet [also called “options”].
Running this code stepwise, as soon as it hits ColumnCount=1, it generates:
BASIC runtime error.
‘423’
Property or method not found: ColumnCount.
I can’t find anywhere hints on how I might write a routine to do the comparable operation in a Calc macro.
Can anyone point me in the right direction?