OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Using calc functions in OOO Basic

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
eduzs
OOo Advocate
OOo Advocate


Joined: 07 Feb 2005
Posts: 356
Location: RJ, BRAZIL

PostPosted: Wed Feb 03, 2010 5:43 am    Post subject: Using calc functions in OOO Basic Reply with quote

I have this code

Code:
X = FuncAcc.callFunction("WORKDAY",ARRAY("2010/2/5",1,X)

X is as optional argument (not workdays to exclude from the calculation).

X should be a cellrange.

Is there a way to send the X as a array, instead of a cellrange?

Ex.: how to send ("2010/12/25";"2010/7/4") to X ?

Thanks
_________________
BrOffice.org 3.2.1
Back to top
View user's profile Send private message
RPG
Super User
Super User


Joined: 24 Apr 2008
Posts: 2697
Location: Apeldoorn, Netherland

PostPosted: Wed Feb 03, 2010 6:06 am    Post subject: Reply with quote

Hello

Sub Main
FuncAcc = createunoservice("com.sun.star.sheet.FunctionAccess")
x = FuncAcc.callFunction("WORKDAY",array(csng(date),3)
print cdate(x),date
End Sub

With thank to Sliderule

Romke
Back to top
View user's profile Send private message
eduzs
OOo Advocate
OOo Advocate


Joined: 07 Feb 2005
Posts: 356
Location: RJ, BRAZIL

PostPosted: Wed Feb 03, 2010 6:42 am    Post subject: Reply with quote

Thanks, but this is not exactly what I an looking for.
This code you send will calculate 3 workdaus before date.
But after de ",3" there is a optional argument, like:
x = FuncAcc.callFunction("WORKDAY",array(csng(date),3, Y)
the question is how to send this Y to the function, cause it should be a cellrange.
_________________
BrOffice.org 3.2.1
Back to top
View user's profile Send private message
RPG
Super User
Super User


Joined: 24 Apr 2008
Posts: 2697
Location: Apeldoorn, Netherland

PostPosted: Wed Feb 03, 2010 7:47 am    Post subject: Reply with quote

Hello

I did see this question only as a third time post of the same question.
I don't know the answer on the other part of the question.

Romke
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group