View Full Version : Open Office Basic

10-20-2017, 09:35 PM
I'm new to this on a MAC and am having trouble getting started. In Visual Basic on my PC I would code the following to put "OK" (without the quotes) in Cell A1 of the first worksheet.

Sub test1()
Dim ws1 as Worksheet
Dim rng1 as Range
set ws1 = Worksheets(1)
set rng1 = ws1.Range("A1")
rng1(1).Value = "OK"
End Sub

In Open Office Basic on my MAC I tried

Sub Main
dim ws1 as Object
dim rng1 as Object
set ws1 = Worksheets(1)
Set rng = ws1.Range("A1")
rng1(1).value = "OK"
End Sub

and got an error message at the Set ws1 line "Sub-procedure or function procedure not defined".

What am I missing?

10-20-2017, 09:39 PM

On the MAC the set rng line was

Set rng1 = ws1.Range("A1")