Consulting

Results 1 to 3 of 3

Thread: Getting Error Message in Excel 2007

  1. #1
    VBAX Regular
    Joined
    Jun 2008
    Posts
    10
    Location

    Cool Getting Error Message in Excel 2007

    Hi All,
    When i used the following two codes in Microsoft Office Excel 2003 with Windows XP as OS it is working fine, but when i tried to run the same code in Microsoft Office Excel 2007 with Windows Vista as OS , i am unable to Run the Code , getting the following Error Message as :-

    Error Message as : Compile error: Can't find project or library

    Code #1 :-
    ~~~~~
    [VBA]
    Trim(Worksheets("Sheet1").Cells(1, 1).Value)
    [/VBA]

    Code #2 :-
    ~~~~~

    [VBA]
    Dim LastRow As Object
    Set LastRow = Sheets("Sheet1").Range("a65536").End(xlUp)
    [/VBA]

    ____________________________________________
    Can some one tell me how can we resolve this problem ....

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    The first thing to check is in the VBIDE, look at Tools>References, and see if there any items that are MISSING. If so, uncheck them.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    Shouldn't LastRow be declared as Range (or Long if finding the row)?
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •