+ Reply to Thread
Results 1 to 6 of 6

Application defined or Object defined error

  1. #1
    Registered User
    Join Date
    03-20-2007
    Posts
    4

    Application defined or Object defined error

    Hi,

    VBA macro which adds hyperlink into the spreadsheet was initially created in Excel 2003. I then saved that spreadsheet as excel 2010. Works perfectly fine for less data (row below 65k) but raises an error for anything greater than that. For instance, I have 70000 records, now macro runs fine and adds hyperlink to all 65532 records but then straight after it gets terminated with "Application defined or Object defined" error (number 1004). Following is the macro code. It would be really helpful if someone can help me



    Sub AddHyperlinks()

    Dim IDVal As Range
    Dim IDQuant As Long
    Dim CurrentSelection As Range

    Range("A1").Select
    Range(Selection, Selection.End(xlDown)).Select
    Set CurrentSelection = ActiveWindow.RangeSelection
    IDQuant = CurrentSelection.Rows.Count

    For rownum = 2 To IDQuant
    Set IDVal = Range("A" & rownum)
    Range("J" & rownum).Select
    ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
    "http://www.nla-eclips.com/NLAAPI.dll/GetObject?ObjectID=" & IDVal, TextToDisplay:=CStr(IDVal)

    Next rownum.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Application defined or Object defined error

    do you actually mean 65532 exactly because that's actually less than the number of rows you had in 2003?
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Application defined or Object defined error

    It may be an excel issue, but try this:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-20-2007
    Posts
    4

    Re: Application defined or Object defined error

    Hi Joseph,

    It always stops at row 65532 with stated error. I even deleted that particular row but still get same error

  5. #5
    Registered User
    Join Date
    03-20-2007
    Posts
    4

    Re: Application defined or Object defined error

    Hi Kyle,

    This update didn't work either.

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Application defined or Object defined error

    could you post a sheet?
    any merged cells?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1