+ Reply to Thread
Results 1 to 4 of 4

Custom macro copypaste method fails - image not be displayed due to memory shortage

  1. #1
    Registered User
    Join Date
    03-30-2010
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2007
    Posts
    3

    Custom macro copypaste method fails - image not be displayed due to memory shortage

    I have a macro which changes a few variables in the input sheet and refreshes the file. Then, for each sheet, it copies the output print area and does a paste-special (enhanced metafile) on to a powerpoint. This process is repeated 85 times producing 85 different powerpoints from the same excel file.

    This macro worked fine as long I was using office 2003. Recently, I migrated to office 2007. There were a few minor changes that had to be made to the macro and it started working fine.

    Except that there is a small hitch. While doing the paste step onto the powerpoint, somehow the process is not completed. The slide is blank. The macro however continues running without any VB error. So, although I now 85 different presentations ready, some random slides are blank.

    The trouble is that there is no pattern to it. It happens with one set of variables once but on repeating the process, there is no issue.

    If I put my cursor on the slide, for a brief moment whenever the issue occurs, I get a message like "image cannot be displayed due to shortage of memory" though not in exact words.

    Any solutions, please.

    Thanks and Regards,
    ssrsp.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Custom macro copypaste method fails - image not be displayed due to memory shorta

    Hi,

    Just a quick thought. Are these 85 print areas being copied into the clipboard memory and never being released?

    Try adding an Application.CutCopyMode = False immediately after you've pasted the chart.

    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    03-30-2010
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Custom macro copypaste method fails - image not be displayed due to memory shorta

    Yes. I have the Application.CutCopyMode = False statement in my code right after pasting the image.

    This line is followed by lines of code where I resize the image to fit the slide size.

    Thanks,
    ssrsp.

  4. #4
    Registered User
    Join Date
    03-30-2010
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Custom macro copypaste method fails - image not be displayed due to memory shorta

    Can anyone kindly help me with this?

    Thanks and Regards,
    Ravi SS

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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