Libra office 25.2.2.2
Calc
Macros
AI just wrote this and it partially works
Doesn’t want to exercise the Macro
(with the quotes off it just calls it right away)
Sub CreateMenu()
GlobalScope.BasicLibraries.loadLibrary(“ScriptForge”)
Dim oDoc as Object, oMenu as Object
Set oDoc = CreateScriptService(“Document”)
Set oMenu = oDoc.CreateMenu(“My Menu”)
With oMenu
.AddItem(“goto Circle”, Command := “gotoCircle”)
'.AddItem(“goto Macros”, Script := “vnd.sun.star.script:Standard.Module1.ItemB_Listener?language=Basic&location=application”)
.Dispose()
End With
End Sub
Sub gotoCircle
dim document as object
dim dispatcher as object
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService(“com.sun.star.frame.DispatchHelper”)
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = “Nr”
args2(0).Value = 2
dispatcher.executeDispatch(document, “.uno:JumpToTable”, “”, 0, args2())
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = “ToPoint”
args3(0).Value = “$D$6”
dispatcher.executeDispatch(document, “.uno:GoToCell”, “”, 0, args3())
End Sub
Blockquote