View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default CopyPicture method of range class failed using RangeName

Both versions of the code you originally posted should work fine in Excel
2003 or earlier, assuming you are returning a valid range object in the
first part before you get to .CopyPicture

If your object variable arrays are declared at procedure level there is no
need to explicitly destroy them, they will loose scope get cleaned up very
efficiently with VBA's garbage collection.

It's a good idea to destroy module level objects when not needed with Set
myObjVar = Nothing, however using them repeatedly should not cause any
problems.

Regards,
Peter T


"CG" wrote in message
Peter,


I am using XL 2003. I believe the problem was I had a subroutine that
used some small arrays of objects and I was not setting them to
Nothing at the end of the routine. They were called several times and
the more the code ran the bigger the problem got. Does that make
sense to anyone?


CG