导出Excel文件“object”未包含“get_Range”的定义
{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)
在 Supcon.MOM.Facade.Export.UltraWebGridExportToExcel(UltraWebGrid grid, String title, Boolean isShowHiddenRow, Boolean isShowHiddenCol, HttpResponse Response)
[解决办法]
Excel.Application xlApp = new Excel.Application(); Excel.Workbook workbook = xlApp.Workbooks.Add(true); Excel.Worksheet worksheet = (Excel.Worksheet)workbook.Worksheets[1]; Excel.Range range; range= worksheet.get_Range(xlApp.Cells[1, 4], xlApp.Cells[RowCount + 2, 4]);
[解决办法]