Add sub function to an onAction parameter

Set Buttons = ActiveSheet.Buttons.Add(t.Left, t.Top , t.Width, t.Height)

	With Buttons
			.OnAction = "Btn3"	
  			.Caption = "Add TestCase to  " & sReturn
  			.Name = "Btn" & i

		End With

Hello, I want to add a function to ONAction. It doesn’t work and I get the Basic runtime error 1. I also asked this question on stack overflow vba - Execute a sub Function on a button which is created programatically - Stack Overflow

Calc doesn’t speak VBA.

@LibreOfficeAmateur: It’s good that you gave the link to the cross-posted question. See my answer on StackOverflow. Also, for this site, do not post as community wiki. See guidelines for asking.