Ask Your Question
1

Eastersunday() in LibreBasic calc

asked 2012-09-26 14:49:16 +0200

llam gravatar image llam
23 4

updated 2013-02-03 10:15:39 +0200

qubit gravatar image qubit flag of United States
5693 3 48 41

In a spreedsheetCell the formula EASTERSUNDAY(2012) works when replaced with the Swedish equivalent word for eastersunday => PÅSKDAGEN(2012)

But when i try to use this function i a LibreBasic macro neither works!

In Swedish the error is (i think) the letter "Å".

EASTERSUNDAY(2012) gives PROCEDURE NOT DEFINED.

How should i do?

I'am using Ubuntu 12.04 and LibreOffice 3.5.4.2

Please help me!

delete close flag offensive retag edit

2 Answers

Sort by » oldest newest most voted
3

answered 2012-09-26 16:10:00 +0200

w_whalley gravatar image w_whalley flag of United States
1581 10 24

Built in functions in LibreOffice can be called from a basic macro, but the argument to the function needs to be passed as an array. I found that tip here.

Here is a function that calls the built in EASTERSUNDAY function

function esunday(year)
svc = createUnoService("com.sun.star.sheet.FunctionAccess")
arg=array(year)
esunday=svc.callFunction("EASTERSUNDAY",arg)
end function

I can't speak to any problem with Å, but maybe you can work it out and let us know.

link delete flag offensive edit
1

answered 2012-09-30 10:19:05 +0200

llam gravatar image llam
23 4

Thank for your answer it works perfectly !

I did a workaround in my macro by placing the formula for eastersunday() in a cell and then read the result, it worked but your solution is better!

Also thanks for your tip-link it will be handy in the future!

Regards llam

link delete flag offensive edit

Comments

So you may mark the answer by @w_whalley as correcthttp://dl.dropbox.com/u/19264180/LibO/mark%20this%20answer%20as%20correct.png ;)

manj_k ( 2012-09-30 13:22:17 +0200 )edit

Thanks. :)

manj_k ( 2012-10-01 10:13:11 +0200 )edit

Login/Signup to Answer

Donate

LibreOffice is made available by volunteers around the globe, backed by a charitable Foundation. Please support our efforts: Your donation helps us to deliver a better product!

Question tools

Follow

subscribe to rss feed

Stats

Asked: 2012-09-26 14:49:16 +0200

Seen: 142 times

Last updated: Sep 30 '12