Run-Time error 5824 - insufficient memory or disk space.

Discussion in 'Word VBA' started by DaveW, Dec 20, 2007.

  1. DaveW

    DaveW Guest

    I have a VB macro which converts text with a document extension to hyperlinks.
    I keep getting the above run-Time error when I pass the text variable
    through as a parameter. I have checked the parameter variable is being passed
    through correctly. Can anybody give me clue to why this has started to
    happen in Office2007?
    a snippet from the code below the second Selection.Hyper...statemement
    works the first causes the error:-

    If LinkType = "H" Then
    Selection.Hyperlinks.Add Anchor:=Selection.Range,
    Address:=FileString, TextToDisplay:=FileString
    Selection.Hyperlinks.Add Anchor:=Selection.Range,
    Address:="c:\thisworks.txt", TextToDisplay:="thisworks"



    --
    Many Thanks
     
    DaveW, Dec 20, 2007
    #1
    1. Advertisements

  2. DaveW

    Nimrod Guest

    Hi,
    You need to write it like this:

    Selection.Hyperlinks.Add Anchor:=Selection.Range, Address:="" & FileString
    & "", TextToDisplay:="" & FileString & ""

    "DaveW" wrote:

    > I have a VB macro which converts text with a document extension to hyperlinks.
    > I keep getting the above run-Time error when I pass the text variable
    > through as a parameter. I have checked the parameter variable is being passed
    > through correctly. Can anybody give me clue to why this has started to
    > happen in Office2007?
    > a snippet from the code below the second Selection.Hyper...statemement
    > works the first causes the error:-
    >
    > If LinkType = "H" Then
    > Selection.Hyperlinks.Add Anchor:=Selection.Range,
    > Address:=FileString, TextToDisplay:=FileString
    > Selection.Hyperlinks.Add Anchor:=Selection.Range,
    > Address:="c:\thisworks.txt", TextToDisplay:="thisworks"
    >
    >
    >
    > --
    > Many Thanks
     
    Nimrod, Jan 1, 2008
    #2
    1. Advertisements

  3. DaveW

    glakshman

    Joined:
    Sep 25, 2013
    Messages:
    1
    Likes Received:
    0
    This is very useful for me. Thanks a lot.

     
    glakshman, Sep 25, 2013
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. stefan

    Insufficient memory problem (5097)

    stefan, Jul 30, 2003, in forum: Word VBA
    Replies:
    1
    Views:
    490
    Word Heretic
    Aug 1, 2003
  2. Aaron Epstein

    word error msg.: insufficient memory

    Aaron Epstein, Aug 10, 2004, in forum: Word VBA
    Replies:
    1
    Views:
    119
    Jezebel
    Aug 10, 2004
  3. Alan
    Replies:
    2
    Views:
    375
  4. John Svendsen

    Insufficient Memory?!?

    John Svendsen, Feb 23, 2005, in forum: Word VBA
    Replies:
    0
    Views:
    124
    John Svendsen
    Feb 23, 2005
  5. Bart Goossens
    Replies:
    1
    Views:
    451
    Howard Kaikow
    Apr 17, 2005
  6. Linda
    Replies:
    5
    Views:
    196
    Ozzie Dugain
    Nov 14, 2006
  7. ML
    Replies:
    1
    Views:
    142
    Hamish Blunck
    Oct 31, 2006
  8. vbaNOOB
    Replies:
    7
    Views:
    137
    Graham Mayor
    Aug 15, 2008
Loading...