Closed Thread
Results 1 to 6 of 6

Memory problems with VBA

  1. #1
    Registered User
    Join Date
    11-22-2016
    Location
    TBA
    MS-Off Ver
    2016
    Posts
    18

    Memory problems with VBA

    Hey everyone,

    I have a macro that accesses a URL in column 1. Then it scans the resulting web page for other URLs and filters it. It then lists the remaining URLs in column B of my excel. Moreover, it accesses each of these links again and checks if the link is working. This is then documented in column C.

    Now, I have a problem that I tried to solve by myself but I did not get there. After running the macro for like 500 links, it gives me an error that there is not enough memory. The computer on which it is running has sufficient RAM and I tried to delete the cache after every iteration with my code (Application.CutCopyMode = False). I also tried to save it after every iteration which makes the entire process slower but apparently does the trick of reducing memory storage sometimes. All these options did not working and I still cannot run the program for more than 400 or 500 links. I need to do it with 45000 though, so doing it all at once would be awesome.

    Can someone identify the problem and maybe fix it? I am really stuck here!

    I attached the current version of the excel with 500 links in it.

    Thank you so much in advance!

    Cheers,
    Jonas
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Memory problems with VBA


    Hi !

    Create objects once before the loop instead of create same objects within loop !

  3. #3
    Registered User
    Join Date
    11-22-2016
    Location
    TBA
    MS-Off Ver
    2016
    Posts
    18

    Re: Memory problems with VBA

    How would it look in the code?

    The thing is that the code always accesses a different link from a loop to the next one. Can you still only create one object at the beginning?

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Memory problems with VBA


    For example, loop must be inside the With CreateObject block, the opposite of your actual code !

    As you can see within so many samples within this forum like this thread

  5. #5
    Registered User
    Join Date
    11-22-2016
    Location
    TBA
    MS-Off Ver
    2016
    Posts
    18

    Re: Memory problems with VBA

    Thanks, I'm really a beginner with all this VBA stuff. The code has been written by someone else from this forum. Would you be able to change the code in the excel file I uploaded in the way necessary to make it work?

    That would be awesome!

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Memory problems with VBA

    Closed at request of JonasKl so it can be posted in Commercial Services. You may review the question and "lock" it there if you have Guru status or above.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Thrashing VBA Memory Leaks. Memory Loop Problems. Uncleared Memory in .Match Range Object
    By Doc.AElstein in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-10-2017, 05:17 PM
  2. Problems refreshing the tables not enough memory!!
    By anaipos in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2016, 09:27 AM
  3. Speed and Memory Problems using Pictures
    By shawnvw in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-22-2014, 02:57 PM
  4. Excel 2010 Memory Problems
    By markinpt in forum Excel General
    Replies: 0
    Last Post: 02-15-2013, 01:34 PM
  5. Excel 2007 : Memory Useage Problems
    By PerseusStoned in forum Excel General
    Replies: 0
    Last Post: 08-10-2010, 10:51 AM
  6. Memory Problems?
    By Caligula in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-01-2008, 03:14 PM
  7. [SOLVED] Memory problems in Excel 2003
    By Richard in forum Excel General
    Replies: 4
    Last Post: 10-19-2005, 09:05 PM

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