Donate

Object does not contain a definition for get_Range (MS Excel) In C#

Team,

Given that you encounter an error such as Object does not contain a definition for get_Range given the original snippet that shows the error below.
chartRange = sheet.get_Range(sheet.Cells[row_indicator, column_indicator],  
sheet.Cells[row_indicator, column_indicator + 11]);
The fix to the code snippet above is to cast the cells with object.
chartRange = sheet.get_Range((object)sheet.Cells[row_indicator, column_indicator],  
 (object)sheet.Cells[row_indicator, column_indicator + 11]); 


Cheers!

Comments

Post a Comment

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

How To Test Or Check Dead Pixels And Backlight Bleed On Your Monitor Using Dead Pixel Checker In Windows 11

How To Insert Or Add Emojis In Microsoft Teams Status Message