Can you post or send to me the function code? I need to see more of the context of the function. -- Jim Thompson Engineering by Impress Life is nonlinear, enjoy the curves. Life is a fairy tale when you are flexible on happily ever after. Go For Broke! ----- Original Message ----- From: Ron To: [email protected] ; [EMAIL PROTECTED] Sent: Monday, February 21, 2005 23:48 Subject: Porting Excel/VBA to Calc
I have been trying to figure out a way to use a range of addresses in a Calc Basic function. the function would be defined as function CrossProduct (aArgs1 As Object, aArgs2 as Object) as Variant aArgs1 would be a three cell array such as A1:C1 and same for aArgs2. The function call would look like =CrossProduct(A1:C1;A2:C2). The result would come back as a three element array. Calculations would be performed using each array element individually. Trying to reference individual cells with terms like aArgs1(1) does not work. I was actually able to pass aArgs1() back as the result of the function with the line CrossProduct() = aArgs1() but cannot evaulate the cells individually. I tried a number of things and looked at a lot of reference material. I thought I had something I could use with the function CellRangeAddressString provided in the appendix of "Porting Excel/VBA to Calc" but that function would not work (in OpenOffice 1.1.4). Can you could provide corrected code for the function? The problem might be in the line select case oRng.getImplementationName() because the function fails at this line with the error message: Basic runtime error. Object variable not set. Thanks, Ron Harris.
