Calc Macro Basic syntax error "Expected: Sub"

Hi! I have started to use Macros in Calc. I get a failure message during the compiling which I cannot solve. Any sugestions (I know it will be a stupid one…): The macro was recorded and not changed. The last line is marked by the compiler with this message: “BASIC syntax error. Expected: Sub”

2025-01-05T23:00:00Z.
EM ***** BASIC *****
Sub Master
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService(“com.sun.star.frame.DispatchHelper”)

rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = “ToPoint”
args1(0).Value = “$F$7”
dispatcher.executeDispatch(document, “.uno:GoToCell”, “”, 0, args1())
End Sub

Here my system info:
Version: 24.8.3.2 (X86_64) / LibreOffice Community
Build ID: 48a6bac9e7e268aeb4c3483fcf825c94556d9f92
CPU threads: 4; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: threaded

REM

and more generally : This is the guide - How to use the Ask site? - #3 by Hrbrgr

1 Like