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 Insert Or Add Emojis In Microsoft Teams Status Message

TypeScript Error Or Bug: The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.