PDA

View Full Version : Copy Images within Selected Cells



Djblois
08-26-2011, 10:47 AM
I use this code to copy what the user has selected and then the add-in can paste it in the body of an email or in a pdf. However, if there is an picture within the range selected it does not copy over. Is it possible to copy over the image also but only if it is within that range:

If frmEmailWork.obWorksheet Then
Set rngeSend = Range(Cells(1, 1), Cells(fnFinalrow(wsWorking), fnFinalColumn(wsWorking)))
Else
Set rngeSend = Range(frmEmailWork.rfRange.Value)
End If

Set wsWorking = Worksheets.Add

rngeSend.SpecialCells(xlCellTypeVisible).Copy
wsWorking.Range("A1").PasteSpecial xlPasteValues
wsWorking.Range("A1").PasteSpecial xlPasteFormats

comResizeAndFit wsWorking 'Resize Columns and Change font to user selected
pagsetAdjustPageWidth False, False, wsWorking 'Adjust Page Width based on Total Column Widths
pagsetPrintHeading wsWorking, wsData.PageSetup.CenterHeader, wsData.PageSetup.LeftHeader, _ wsData.PageSetup.RightHeader

Kenneth Hobs
08-26-2011, 02:20 PM
Cross posted http://www.excelforum.com/excel-programming/789832-copy-images-within-selected-cells.html

A message to forum cross posters: http://www.excelguru.ca/node/7

Djblois
08-31-2011, 06:22 AM
Sorry about the crossposting - did not realize it was an issue. I will follow those guidelines. This issue is now pretty much fixed. However, I have one more issue and that is that when it gets pasted into outlook wherever the picture is supposed to be I get an error that says Out of Memory.

Please any answers post to my original posting here:

http://www.excelforum.com/excel-programming/789832-copy-images-within-selected-cells.html