其他分享
首页 > 其他分享> > Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: “object”未包括“get_Range”的定义

Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: “object”未包括“get_Range”的定义

作者:互联网

asp.net操作Excel合并单元格时,抛出了异常:
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: “object”未包括“get_Range”的定义 
在 CallSite.Target(Closure , CallSite , ComObject , Object , Object ) 
在 System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) 
在 CallSite.Target(Closure , CallSite , Application , Object , Object ) 
在 System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) 

开发环境:VS2010+Framework4.0+Microsoft.Office.Interop.Excel 11.0
解决方式:
    2.0  worksheet.get_Range(worksheet.Cells[1, 1], worksheet.Cells[1, 3]).Merge(mValue);
    4.0  Microsoft.Office.Interop.Excel.Range range = worksheet.Range[worksheet.Cells[1, i + 1], worksheet.Cells[2, i + 1]];
            range.MergeCells = true;  

原文链接:https://www.cnblogs.com/slgkaifa/p/6724287.html

标签:Object,RuntimeBinder,get,worksheet,Cells,object,T2,CallSite,Range
来源: https://www.cnblogs.com/gisoracle/p/16244854.html