+ Reply to Thread
Results 1 to 7 of 7

runtime error “out of memory”+excel macro

  1. #1
    Registered User
    Join Date
    12-16-2009
    Location
    surat
    MS-Off Ver
    Excel 2007
    Posts
    9

    runtime error “out of memory”+excel macro

    hi experts. i have one macro,which i called when cell change. this macro select images and delete them and insert another image depending on cell value using following code. i have same code for two sheets.
    Please Login or Register  to view this content.
    in one sheet its working perfectly fine and delete all images while in other sheet , it give me runtime error "out of memory" and highlight following line.
    Please Login or Register  to view this content.

    can any one tell me why this is happening? it works perfectly fine in one and not in other.

    one other thing i want to tell you is. it was working fine when i gave this macro excel to my client,both sheets were working fine, suddenly after 2 days, he started getting error on one sheet on which he was working lot.

    dont know why this is happening. can anyone tell me whats reason and how to solved it?

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,980

    Re: runtime error “out of memory”+excel macro

    Does he have an autofilter applied to the second sheet (or has he had one)?
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    12-16-2009
    Location
    surat
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: runtime error “out of memory”+excel macro

    Quote Originally Posted by romperstomper View Post
    Does he have an autofilter applied to the second sheet (or has he had one)?
    means? i didnt get it sir. can you explain in bit more detail?

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,980

    Re: runtime error “out of memory”+excel macro

    I mean, has he applied a filter to the second sheet (where the code fails)? If so, your code will be trying to select the filter dropdowns, which you can't do. You need to loop through the shapes, check if each one is a picture and then delete it if so.

  5. #5
    Registered User
    Join Date
    12-16-2009
    Location
    surat
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: runtime error “out of memory”+excel macro

    Quote Originally Posted by romperstomper View Post
    I mean, has he applied a filter to the second sheet (where the code fails)? If so, your code will be trying to select the filter dropdowns, which you can't do. You need to loop through the shapes, check if each one is a picture and then delete it if so.
    ok got it, i will ask him and let you know.
    right now i have change selectall to this.
    Please Login or Register  to view this content.
    my sheet will always have one image, will this work??

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,980

    Re: runtime error “out of memory”+excel macro

    Not necessarily. If it's a picture rather than an image control, you could use:
    Please Login or Register  to view this content.
    instead.

  7. #7
    Registered User
    Join Date
    12-16-2009
    Location
    surat
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: runtime error “out of memory”+excel macro

    Quote Originally Posted by romperstomper View Post
    Not necessarily. If it's a picture rather than an image control, you could use:
    Please Login or Register  to view this content.
    instead.
    i am not expert in excel macro.

    following is code which add image to excel. so looking at it it seems its picture.
    right?
    Please Login or Register  to view this content.

+ 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