I would like to represent the following function in SpreadsheetGear
public static string GetAddress( IRange range )
{
return range.GetAddress( true, true, ReferenceStyle.A1, true, null );
}
Where I can use this in an Excel file where a cell has a formula of one of the following:
- =GetAddress(A2),
- =GetAddress(A2:B3), or
- =GetAddress(NamedRange)
But I can't figure out how to get a 'IRange reference' from the IArguments parameter of a custom function.
Thanks in advance.
There is no way to determine what range is being referenced (if any) for an argument that is passed into a custom function. In fact, allowing access to such an IRange object within your custom function would break one of the rules laid out in the Remarks section of our documentation for the Function.Evaluate(...) method: