I'm trying to create a spreadsheet and after I populate it with the data I want to use the subtotal on a range. This is easy to do through the interop (range.Subtotal(...)), but I haven't figured out how to do it through the Excel Engine (if I can at all).
Is it possible? If so, how?
Thanks
Jason
There is no equivalent of the Subtotal method in the Excel object model. You can apply a formula to a cell which uses the SUBTOTAL or SUM functions to create a subtotal manually. You can also submit a feature request for a method to accomplish this automatically: http://devcenter.infragistics.com/Protected/RequestFeature.aspx.
Mike Dour"]You can apply a formula to a cell which uses the SUBTOTAL or SUM functions to create a subtotal manually.
This is exactly the problem. We cannot use SUBTOTAL in a formula. It seems that we cannot use any function that requires two or more arguments.
What code are you using to apply the formula? This could be a bug. You can also submit this to the support group: http://es.infragistics.com/gethelp.
Mike Dour"]What code are you using to apply the formula?
I tried
Formula::Parse("=SUBTOTAL(3,RC1:R4C1)", CellReferenceMode::R1C1)->ApplyTo(objCell);
and
objCell->ApplyFormula("=SUBTOTAL(3,B1:B5)");
Regards,
Mark Junker
HI,
How to apply formula to excel,
Please send me the code.
I have formula like =HYPERLINK("c:\test\Doc1.doc","TEXT")
How to apply this formula. This formula displaying as =HYPERLINK("c:\test\Doc1.doc","TEXT") I am not getting hyperlink.To get hyperlink manually I have to press enter key.
You apply a formula to a cell by using the ApplyFormula method on a cell or by creating a new Formula instance with the static Formula.Parse or Formula.TryParse methods, then calling ApplyTo on it and passing it a cell reference.