When Asp.net is used to merge cells in an Excel file, an exception is thrown:
Microsoft. CSHARP. runtimebinder. runtimebinderexception: "object" does not include the definition of "get_range" in callsite. target (closure, callsite, comobject, object, object) in system. dynamic. updatedelegates. updateandexecute3 [t0, T1, T2, Tret] (callsite site, t0 arg0, T1 arg1, T2 arg2) at callsite. target (closure, callsite, application, object, object) in system. dynamic. updatedelegates. updateandexecute3 [t0, T1, T2, Tret] (callsite site, t0 arg0, T1 arg1, T2 arg2)
Development Environment: vs2010 + framework4.0 + Microsoft. Office. InterOP. Excel 11.0
Solution:
2.0 worksheet. get_range (worksheet. cells [1, 1], Worksheet. cells [1, 3]). Merge (mvalue );
4.0 Microsoft. Office. InterOP. Excel. Range = worksheet. Range [worksheet. cells [1, I + 1], Worksheet. cells [2, I + 1];
Range. mergecells = true;