• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA for PARTIAL worksheet screenshot - NOT the printscreen method

bryancouch

New Member
I need code that will take a "partial" screenshot of the active sheet and paste it into the body of an Outlook email. The "partial" screenshot could be defined by some sort of OFFSET code, or by directly naming the XY coordinates of the screen....please help...
 
You could try using the camera tool. Select the region of cells you want a picture of, copy it, then, holding down Shift, go to Edit - Paste Picture Link. You now have a real time picture of the cells, and you could copy that into outlook.
 
Thanks Luke, I was not familiar with the camera tool so i added it to the ribbon and then recorded a macro to see how it works. When I try to run the macro, it breaks in the 3rd line (see code below). I simply used the tool to take a screenshot of a graph and pasted the image on the same worksheet. Then I deleted the image and tried to re-run the macro, but it always breaks on line 3. I am far from being a VB expert; I usually rip off code from the net and am able to customize it, but am very poor at really understanding what I am doing........


Sub cam()

'

' cam Macro

'


'

Range("C2:O13").Select

Selection.Copy


'this is the line that always breaks:


ActiveSheet.Shapes.AddShape(, 977.25, 30#, 72#, 72#).Select


ActiveSheet.Shapes.Range(Array("Picture 13")).Select

Application.CutCopyMode = False

Application.Goto Reference:="R2C3:R13C15"

ActiveCell.FormulaR1C1 = _

"MILL: AVERAGE PACKAGE TPD "

Range("S19").Select

End Sub
 
This should help clear things up.

[pre]
Code:
Sub MakePicture()
'What range to copy?
Range("C2:O13").Copy
'Where should picture be pasted? Change as needed
Range("A1").Select
'Pastes the image
ActiveSheet.Pictures.Paste(Link:=True).Select

Application.CutCopyMode = False
End Sub
[/pre]
 
Back
Top