We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question

BASIC runtime error. Sub-procedure or function procedure not defined

asked 2018-11-02 21:24:59 +0200

student gravatar image

I tried the following test macro in libreoffice, but get an error:

"BASIC runtime error. Sub-procedure or function procedure not defined"

Function Test(x)
End Function

How can I fix it?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2018-11-02 21:38:20 +0200

Ratslinger gravatar image

updated 2018-11-02 21:39:25 +0200


Round is a function called from the sheet. You can use these in macros but must do so by a call using arguments:

Function Test(x)
    oFunction = createUnoService("com.sun.star.sheet.FunctionAccess")
    dim aArgument(1) as variant
    Test = oFunction.callFunction( "Round", aArgument() )
End Function
edit flag offensive delete link more


Thanks, is there also a function accessible directly from basic which does the same as the round function from the sheet?

student gravatar imagestudent ( 2018-11-02 22:17:26 +0200 )edit

Don't see any command in Basic for that.

Ratslinger gravatar imageRatslinger ( 2018-11-02 22:28:27 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-11-02 21:24:59 +0200

Seen: 1,642 times

Last updated: Nov 02 '18