PDA

View Full Version : Copying Excel range to Word doesn't copy the image



Ganamede
10-21-2012, 11:52 AM
Here is what I am doing using Excel 2007 and Word 2007. I have an excel document that is an invoice. The invoice has a logo on it. I run a VBA macro that copies the entire range of the spreadsheet, creates a Word document, then pastes it into the Word document. I am doing this for a client who has roughly 40 computers in his fleet. It works exactly as expected on all but 5 or 6 computers, all running Office 2007. On those machines, the copy and paste operation does not copy the logo image from Excel to Word. The weird thing is, if you double click the object from within Word (since its embedded as a wdOleObject) the logo actually shows up, although part of it is often cut off as if its cropped (but it isn't cropped using the crop tool, its just cut off). Once you click away and deselect the object, the image remains, although cut off.

So far I have tried pasting using different object types and wdPasteMetafilePicture actually works, but its very fuzy because of the resizing, so I'd rather not have to do it that way.

Here is the brief of what I'm doing:

ThisWorkBook.sheet("WorkOrder").Select
Range("A1:J52").Copy
wrdApp.Selection.PasteSpecial Link:=False, DataType:=Word.WdPasteDataType.wdPasteOLEObject, Placement:=wdInLine, DisplayAsIcon:=False

Does anyone have any idea about what I could try? Has anyone ever heard of this before? Any help would be appreciated.

GTO
10-22-2012, 03:57 AM
May be of no help, but could you zip the .doc(?), .xls(?) and image (of same type (.jpg, .bmp, etc)) ?