SpreadsheetGear 2010
Evaluate Method
See Also  Send Feedback
SpreadsheetGear.CustomFunctions Namespace > Function Class : Evaluate Method

arguments
Provides access to the arguments to this custom function. Note that using the IArguments indexer has the side effect of converting a range reference or array to a simple value (use GetArrayDimensions and GetArrayValue to get individual values from a range or array).
result
Assign the result of the custom function to result. The value of result is undefined until set by the Evaluate method.
Evaluates a custom function with the specified arguments. See the remarks in the help for this method for a number of rules which must be taken into account.

Syntax

Visual Basic (Declaration) 
Public MustOverride Sub Evaluate( _
   ByVal arguments As IArguments, _
   ByVal result As IValue _
) 
C# 
public abstract void Evaluate( 
   IArguments arguments,
   IValue result
)

Parameters

arguments
Provides access to the arguments to this custom function. Note that using the IArguments indexer has the side effect of converting a range reference or array to a simple value (use GetArrayDimensions and GetArrayValue to get individual values from a range or array).
result
Assign the result of the custom function to result. The value of result is undefined until set by the Evaluate method.

Remarks

The implementation of this method must follow a number of rules:

  • The method must be thread safe. Future versions of SpreadsheetGear may call this method from multiple threads at the same time.
  • The method must not use any API in the workbook set which is being calculated except for IArguments.CurrentWorksheet.Name, IArguments.CurrentWorksheet.Index or IArguments.CurrentWorksheet.Workbook.Name.
  • All access to cells must be through arguments.
  • Accessing the IArguments indexer has the side effect of converting references to ranges or arrays to a single simple value. Use SpreadsheetGear.CustomFunctions.IArguments.GetArrayDimensions and SpreadsheetGear.CustomFunctions.IArguments.GetArrayValue to access the individual values of a range or array. For example, if the first custom function argument is the range A1:C3, setting a watch on arguments[0] in a debugger will convert this range to a single simple value.
  • No references to interfaces or objects passed to, or acquired during the execution of this method should be used after this method completes execution.

If an exception is thrown during custom function evaluation, the custom function will return ValueError.Name.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

Copyright © 2003-2010 SpreadsheetGear LLC. All Rights Reserved.Help Powered by Innovasys   
SpreadsheetGear is a registered trademark of SpreadsheetGear LLC.
Microsoft, Microsoft Excel and Visual Studio are trademarks or registered trademarks of Microsoft Corporation.