c#操作Excel: get_range异常

The script is as below:

1
range = worksheet.get_Range(excelAPP.Cells[1, 1], excelAPP.Cells[1, colIndex]);

When i design this on VS 2010, it’s work fine, but i run on VS 2015, have an error:
Additional information: ‘object’ does not contain a definition for ‘get_Range’

Solution:

1
range = worksheet.Range[worksheet.Cells[1, 1], worksheet.Cells[1, colIndex]];

唐胡璐 wechat
欢迎您扫一扫上面的微信公众号,订阅我的博客!
分享创造价值,您的支持将鼓励我继续前行!