A Calc macro I've been tweaking for two days now has suddenly decided to start throwing a "Function or sub-procedure is not defined" error at me over a simple Round() function. It was working fine before, and now even a macro that's nothing but a Round() function will give me a runtime error.
I'm assuming this means something, somewhere went missing, but I have no idea what or where. I've already tried to uninstall OpenOffice, deleted all app data, and reinstalled, but no dice.
I've no idea where to even begin looking for a solution, and my Google-fu has failed me woefully.
Help? Ideas? Vague points? Condolences?
[Solved] Round() "not defined"
[Solved] Round() "not defined"
Last edited by femgeek on Mon Feb 04, 2013 1:41 pm, edited 1 time in total.
OpenOffice 3.4.1 on Windows 7 (64bit)
Re: Round() "not defined"
No matter what everyone thinks, reinstalling OpenOffice does not affect the User Profile. The first step for any fix for sudden OpenOffice peculiarities is to delete (if a beginner) or rename (if you have OpenOffice customisation) the User Profile. Details are at
[Tutorial] The OpenOffice User Profile
[Tutorial] The OpenOffice User Profile
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: Round() "not defined"
Sorry, should've been clearer! I did delete all the app data, including the user profile, as well as the folder in Programs just in case, before reinstalling OO. It seems to've been a clean reinstall -- my macro was gone, as were my keyboard shortcuts, etc. Still getting the same error.
OpenOffice 3.4.1 on Windows 7 (64bit)
-
- Volunteer
- Posts: 1160
- Joined: Mon Oct 08, 2007 1:26 am
- Location: France, Paris area
Re: Round() "not defined"
Hi,
Since your macro worked before :
- either it called a user-declared Function named as Round()
- or you have deleted the line Option VBAsupport 1 at top of the Basic module.
In OpenOffice Basic, Round() function does not exist.femgeek wrote:A Calc macro I've been tweaking for two days now has suddenly decided to start throwing a "Function or sub-procedure is not defined" error at me over a simple Round() function. It was working fine before, and now even a macro that's nothing but a Round() function will give me a runtime error.
Since your macro worked before :
- either it called a user-declared Function named as Round()
- or you have deleted the line Option VBAsupport 1 at top of the Basic module.
Bernard
OpenOffice.org 1.1.5 / Apache OpenOffice 4.1.1 / LibreOffice 5.0.5
MS-Windows 7 Home SP1
OpenOffice.org 1.1.5 / Apache OpenOffice 4.1.1 / LibreOffice 5.0.5
MS-Windows 7 Home SP1
Re: Round() "not defined"
Aha! Didn't recall ever seeing the line "Option VBAsupport 1" at the top of the module, but I did realise I'd deleted the "REM ***** BASIC *****" line at the top. Fixed that, and it works like a charm.
Many thanks, B Marcelly. You're a Prinec(ess) among (wo)men!
Many thanks, B Marcelly. You're a Prinec(ess) among (wo)men!
OpenOffice 3.4.1 on Windows 7 (64bit)
Re: Round() "not defined"
You can define your own Round(m, n) function in OpenOffice Basic, thus:B Marcelly wrote:In OpenOffice Basic, Round() function does not exist.
Code: Select all
Function Round(m, Optional n)
' Round a number "m" to "n" decimal places
' If "n" isn't supplied, round to zero decimal places
If IsMissing(n) Then n = 0
Round = Int(m*10^n + .5)/10^n
End Function
If n>0 it will round to the right of the decimal point.
If n=0 it will round down to zero decimal places.
The second parameter "n" is optional. If n is omitted, it behaves like Round(m, 0).
OOo 3.4 - Ubuntu Linux 10.04