0
請幫助我: 我想使用OOoTools.pas 界面確定開放式辦公室計算列中的最大值。 以此爲FAS,因爲我來了:OpenOffice Automation Delphi如何使用callfunction
Procedure FindMaximum(oMySheet : Variant);
Var
oFuncService : Variant;
Begin
oFuncService := CreateUnoService('com.sun.star.sheet.FunctionAccess');
ShowMessage(oFuncService.callFunction('MAX', VarArrayOf([10,20,50])));
End;
這工作
我當然要填寫的一列類似的值:
ShowMessage(oFuncService.callFunction('MAX', VarArrayOf([oMySheet.getCellRangeByName('K8:K10')])));
我得到的消息「com.star .lang.IllegalArgumentException:」。爲什麼? 謝謝
錯誤:= oFuncService.callFunction( 'MAX',VarArrayOf([oCellRange])); – addelichtman 2010-10-14 15:06:40
Hello The_Fox,然後出現「Type Mismatch」錯誤 – addelichtman 2010-10-14 15:11:11
@addelichtman:K8:K10範圍內可能有無效值嗎?文字而不是數值? – 2010-10-14 15:53:28