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.
Ok, there seems to be a bug in 8.2.20082.1000 which seems to be fixed in 8.3.20083.1009.
Regards,
Mark Junker
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.
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.
I was able to use these formulas in cells, save out the workbook, and verify that the formulas evaluated correctly. Are you getting an exception when you apply the formula or is it solving incorrectly in Excel? Also, what version of the Excel assembly are you using? Its possible this was a bug with an older version and it has since been fixed.
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)");