c# excel range.FormulaArray, if you have time can you try below c# program with two different FormulaArrays -


Can someone tell me why this does not work

  Excel.Worksheet ws_res = (Excel worksheet) wb.Worksheets.Add (wrong, wrong, wrong, wrong); Excel.Range range_res = (Excel.Range) ws_res.get_Range ("A1", "HM232"); Range_res.FormulaArray = "= ROUND (IF ((IF (Sheet4 A1: HM232 = 1.0," + IF (Sheet4A1: HM232 = 0,1, Sheet4A1: HM232))) = 1, 0, " + "IF ((IF (Sheet4 A1: HM232 = 1.0," + "IF (Sheet4 A1: HM232 = 0,1, Sheet4A1: HM232))) = 0,1, (" + "IF (Sheet4A1 : HM232 = 1.0,! "+" IF (Sheet4 A1: HM232 = 0,1, Sheet4A1:! HM232)))))), 0) ";  

but it does

  Excel.Worksheet ws_res = (Excel.Worksheet) wb.Worksheets.Add (wrong, wrong, wrong, wrong); Excel.Range range_res = (Excel.Range) ws_res.get_Range ("A1", "HM232"); Range_res.FormulaArray = "= ROUND ((IF (Sheet4 A1: HM232 = 1.0, IF (Sheet4 A1: HM232 = 0,1, Sheet4 A1:! HM232)), 0)";  

======================================= =================================

But if I copy and paste the above two formulas in the formula bar of Excel 2007 If so, press Ctrl + Shift + Enter, both work perfectly!

=========================================== ============

I have also changed the above two formulas into A1: R1C1 to HM232: R232C221, again # less one works fine, but so far Generates an exception!

This works for me I believe that you have to work with Sheet 4 (less formula ) Or when you remove quotation marks you create a typo, and line breaks are there. Now what do I have in my formula bar:

  = round (if (((Sheet 4! A1: Hm 232 = 1.0, if (Sheet 4! A1: Hm 232 = 0,! 1, Sheet4 A1: HM232)) = 1,0, IF ((IF (Sheet4 A1: HM232 = 1.0, IF (Sheet4 A1: HM232 = 0,1, Sheet4 A1: HM232)) ) = 0,1, (If (Sheet 4! A1: Hm 232 = 1.0, If (Sheet 4! A1: Hm 232 = 0,1, Sheet 4! A1: HM 232))))) )), 0)  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -