In demos of C # 4.0, I see a lot of code using a dynamic type. For example, the following code sets the value of an Excel cell:
excel.Cells [1, 1] .Value = ...
However, you can also access the cell in an early way with a throw:
((Range) excel.Cells [1, 1]). Value = ...;
Why doesn't Excel Excel COM library just describe cell type as range type? Similarly, all arguments to the following method are dynamic:
excel.ActiveWorkbook.Charts.Add (...)
Why were the arguments not static? Considering the Excel object model, dynamic types exist around the world. Is it because of limitations in expressiveness in COM? Is there a pattern when COM libraries use dynamic types rather than static types?
Anonymous
source share