We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Use Yield function of excel

Hi,

I am trying to use the YIELD function of excel via syncfusion.XlsIO. But it is giving error "Yield isn't custom function"

I tried using microsoft excel object and found that i have to add the addin in my code
oXL.AddIns["Analysis ToolPak - VBA"].Installed = true;

Can you please let me know who i can make this work using SyncFusion object.

Thanks
-Sanjeev Soni




1 Reply

YG Yavanaarasi G Syncfusion Team February 16, 2008 07:39 AM UTC

Hi sanjeev,

Thank you for your interest in Essential XlsIO.

In order to make XlsIO to use YIELD() function we need to register it as custom add-in function and make XlsIO also recognize it. We can do that by using the following code snippet:

//Define Function
IAddInFunctions unknownFunctions = workbook.AddInFunctions;
unknownFunctions.Add( "YIELD" );

//Use Function
sheet.Range[ "A3" ].Formula = "YIELD(A1+\" CORP\",\"PX_LAST\")";

Please refer the sample in the below link which illustrates the above:

http://websamples.syncfusion.com/samples/XlsIO.Windows/71824/main.htm

Please let me know if this helps.

Regards,
G.Yavana



Loader.
Live Chat Icon For mobile
Up arrow icon