To launch a macro, it was posted to use this code:
Code: Select all
Sub CreateButton
oDoc = ThisComponent
oSheet = oDoc.Sheets.getByIndex(0)
oDrawPage = oSheet.DrawPage 'Was oDrawPage = oDoc.getDrawPage()
sScriptURL = "vnd.sun.star.script:Standard.Module1.ButtonPushEvent?language=Basic&location=document"
oButtonModel = AddNewButton("Button_1", "Button_1", oDoc, oDrawPage)
oForm = oDrawPage.getForms().getByIndex(0)
' find index inside the form container
nIndex = GetIndex(oButtonModel, oForm)
AssignAction(nIndex, sScriptURL, oForm)
End Sub
Where do you define the macro that you wanr lunched?? For example: I have a macro called NEWENTRY and the below image shows where it is in the macro tree. How do I define it in the hyperlink code??
I
Edit: Split from [Solved] Calc basic macro to add a button to a cell New problem should have new topic. |