CONCEPT: In a nutshell I wrote a code that copies a range as a picture, pastes the picture on a new tab, resizes the picture to fit the page then goes back and copies the a new range, pastes the picture on the newly created tab, uses the last row of the previous picture to offset and then resizes to fit the page. This process repeats several times. At the end of the routine it saves the worksheet as a pdf for record.

PROBLEM: The code works some of the time, and other times it does not. When it does not work it generates error “pastespecial method of range class failed”. I find that I am typically able to diagnose the problem by isolating it using the locals or watch window. For the life of me I cannot find a way to consistently duplicate this error and none of the variable come back with errors when I slowly step through the routine. Not sure how to go about this.
Maybe one of the more expert gurus will be able to identify and glaring discrepancies in my code that stand out…I hope. The error is generated on the line marked in red.

Any other advice in general code structure would be appreciated. Thank you.

The code is as follows:

Please Login or Register  to view this content.