Hi Experts! :)
I posted a question a few days ago regarding taking a screenshot of an excel worksheet's data area and then embedding that screenshot into the body of an email message composed in MS Outlook 2010. The expert who assisted successfully answered my question and the code works great!
Below is a link to the previous answered post with the sample code and workbook:
Previous Screenshot/ Embed Image in Outlook 2010 email message body post
My question now is it possible to make it dynamic meaning if the data area size changes is it possible to have to code auto adjust to the new data range? Right now its set for the current size A1:P40 in this part of the code.
Private Sub cmdEmail_Click()
Dim oRange As Range
Dim oCht As Chart
Dim oImg As Picture
Set oRange = Range("A1:P40")
Set oCht = Charts.Add
oRange.CopyPicture xlScreen, xlPicture
oCht.Export Filename:="C:\Temp\SavedRange.jpg", Filtername:="JPG"
Screenshot_Mail "Sample Email Address" & "; " & "Sample Email Address", "Sample Email Address" & _
"; " & "Sample Email Address" & "; " & "Sample Email Address", "Rep II Case Productivity Report", "<font color=red>" & _
"<I>" & "Below is a Snapshot View of the Rep II Case Productivity Report: " & "</font>" & "</I>" & _
"<BR>" & "<BR>" & "<BODY><FONT face=Arial color=#000080 size=2></FONT>" & _
"<IMG alt='' hspace=0 src='C:\Temp\SavedRange.jpg' align=baseline border=0> </BODY>"