How to create shared formula in Excel via Automation -
i write vc automation program importing type library of excel 2003 , using classes. how create shared formula via automation classes. cannot find property/method in ms document related create shared formula.
thanks
we can use range.copy creating shared formula.
and parameter of method target range.
please @ below sample:
excel.worksheet objworksheet= (excel.worksheet)globals.thisworkbook.activesheet;
excel.range oresizerange; objworksheet.cells[1, 5] = "1.33"; objworksheet.cells[2, 5] = "1.565"; objworksheet.cells[3, 5] = "1"; objworksheet.cells[4, 5] = "1"; objworksheet.cells[5, 5] = "1"; objworksheet.cells[6, 5] = "1"; oresizerange = objworksheet.get_range("e8", "e8").get_resize(missing.value, 1); oresizerange.formula = "=sum(e2:e6)"; objworksheet.range["f1"].formula = "=e1*10"; objworksheet.range["f1"].copy(objworksheet.get_range(ows.range["f2"], objworksheet.range["f8"]));
this c# sample , found same method in vc .
Comments
Post a Comment