Basic syntax error . Symbol expected

I have created a macro but when I am trying to run the macro I am getting this error “BASIC syntax error . Symbol expected”

REM  *****  BASIC  *****

Sub Main

End Sub



sub Libre
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(4) as new com.sun.star.beans.PropertyValue
args1(0).Name = "TopBottomMargin.TopMargin"
args1(0).Value = 0
args1(1).Name = "TopBottomMargin.BottomMargin"
args1(1).Value = 0
args1(2).Name = "TopBottomMargin.ContextMargin"
args1(2).Value = false
args1(3).Name = "TopBottomMargin.TopRelMargin"
args1(3).Value = 100
args1(4).Name = "TopBottomMargin.BottomRelMargin"
args1(4).Value = 100

dispatcher.executeDispatch(document, ".uno:TopBottomMargin", "", 0, args1())

rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "NumberingStart"
args2(0).Value = false

dispatcher.executeDispatch(document, ".uno:NumberingStart", "", 0, args2())

rem ----------------------------------------------------------------------
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "NumNewStartAt"
args3(0).Value = 65535

dispatcher.executeDispatch(document, ".uno:NumNewStartAt", "", 0, args3())

rem ----------------------------------------------------------------------
dim args4(4) as new com.sun.star.beans.PropertyValue
args4(0).Name = "CharFontName.StyleName"
args4(0).Value = ""
args4(1).Name = "CharFontName.Pitch"
args4(1).Value = 2
args4(2).Name = "CharFontName.CharSet"
args4(2).Value = 0
args4(3).Name = "CharFontName.Family"
args4(3).Value = 0
args4(4).Name = "CharFontName.FamilyName"
args4(4).Value = "FreeSerif"

dispatcher.executeDispatch(document, ".uno:CharFontName", "", 0, args4())


end sub

There is not any error message in my LO6.1.6 version launched the macro in a new empty Writer document.

Please upload your sample fle here.