Results 1 to 8 of 8

Run-time error '7': Out of memory

Threaded View

  1. #1
    Registered User
    Join Date
    10-09-2013
    Location
    Oslo
    MS-Off Ver
    Excel 2010
    Posts
    4

    Run-time error '7': Out of memory

    I am trying to run a small script that is intended to change part of the hyperlink address of all hyperlinks in an excel sheet (there are a few hundred links that are now pointing to the wrong server, i.e. the file names will be maintaned, but the server path needs to be changed). I have tried two different scripts, both produce the same error, "Run-time error '7': Out of memory". The scripts look like this:

    Sub ChangeHyperlinks()
        Dim hl As Hyperlink
        For Each hl In ActiveSheet.Hyperlinks
            hl.Address = Replace(hl.Address, "../../oldpath/", "../../newpath/")
        Next
    End Sub
    
    and
    
    Sub ChangeHyperlinks2()
    Dim OldStr As String, NewStr As String
    OldStr = "../../oldpath/"
    NewStr = "../../newpath/"
    Dim hyp As Hyperlink
    For Each hyp In ActiveSheet.Hyperlinks
        hyp.Address = Replace(hyp.Address, OldStr, NewStr)
        
    Next hyp
    
    End Sub
    Both of them error in the Replace part. Anybody got an idea?

    Moderator Note:

    Pls use code tags around your code next time as per forum rules.
    Last edited by Fotis1991; 10-09-2013 at 06:55 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Run-time error 7: out of memory
    By gandrea in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-06-2012, 08:16 PM
  2. [SOLVED] Run-time error 7 out of memory vba
    By Jovica in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-19-2012, 09:08 AM
  3. Run-time error 7 out of memory vba
    By Macro1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2010, 09:42 AM
  4. Run-time error '7': Out of memory
    By rpollard001 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2006, 04:45 PM
  5. Run-time error '7': Out of memory
    By rpollard001 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-11-2006, 02:15 AM

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