+ Reply to Thread
Results 1 to 7 of 7

VBA run-time error 1004 with hyperlinks.add

  1. #1
    Registered User
    Join Date
    06-26-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    24

    Question VBA run-time error 1004 with hyperlinks.add

    I've encountered a run-time error '1004': Application-defined or object-defined error and the debugger highlights the following code:
    Please Login or Register  to view this content.
    The odd thing is that this error only displays once the loop has reached row 20349. For the life of me, I can't figure out this out. There is nothing different about row 20349 and there are a total of about 45,000 rows in the worksheet.

    -- Full Subroutine --

    Please Login or Register  to view this content.
    Last edited by bfs3; 03-27-2014 at 02:11 PM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: VBA run-time error 1004 with hyperlinks.add

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)


    Also, why are you adding hyperlinks that don't link to anything? You could just add text with maybe a cell comment.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    06-26-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: VBA run-time error 1004 with hyperlinks.add

    Sorry about the formatting - I was in a rush.

    The hyperlinks actually call macro depending on the TextToDisplay of the hyperlink.

    Please Login or Register  to view this content.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA run-time error 1004 with hyperlinks.add

    Is that the only purpose of the hyperlinks?
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    06-26-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: VBA run-time error 1004 with hyperlinks.add

    Yes. I couldn't think of a better way to run a macro by clicking a cell. I'm open to suggestions, though.

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: VBA run-time error 1004 with hyperlinks.add

    This will run Macro1 when you select a cell in column T that has the text "Update"

    To install this code:
    • Right-click on the sheet tab
    • Select View Code from the pop-up context menu
    • Paste the code below in the worksheet's code module


    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-26-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: VBA run-time error 1004 with hyperlinks.add

    Thanks, AlphaFrog. That works for me.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Addon error : Run-time error '1004': Method 'MacroOptions' of object '_Application' failed
    By jtcoleman in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 3
    Last Post: 02-05-2014, 12:23 PM
  2. Replies: 4
    Last Post: 11-15-2013, 05:03 PM
  3. VBA Code...error = run time error 1004 autofilter method of range class failed
    By Dariusd7 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-15-2013, 04:49 PM
  4. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM
  5. [SOLVED] run-time error '1004': Application-defined or object-deifined error
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-10-2005, 05:05 PM

Tags for this Thread

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