'object' does not contain a definition for 'get_Range' error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aftab461
    New Member
    • Aug 2011
    • 1

    #1

    'object' does not contain a definition for 'get_Range' error

    I am using this code :

    Excel.Range rang = oSheet.get_Rang e(oSheet.Cells[index + 1, "A"],oSheet.Cells[index+1]

    to get the range of entire row but having error:
    "'object' does not contain a definition for 'get_Range'"
    Last edited by aftab461; Aug 14 '11, 11:40 PM. Reason: change title
  • Paul Johnson
    New Member
    • Oct 2010
    • 97

    #2
    just means get_Range doesn't exist. Is this your own method or one provided?

    Comment

    • Paul Johnson
      New Member
      • Oct 2010
      • 97

      #3
      http://support.microsoft.com/kb/302096 may be of some help here

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        oSheet is probably not "boxed" into the object you think it is.
        Type cast it to the correct object type.
        Maybe something like ((Excel.Sheet)o Sheet).get_Rang e

        Also make sure you have the capitalizations correct

        Comment

        Working...