Consulting

Results 1 to 2 of 2

Thread: Copying Excel range to Word doesn't copy the image

  1. #1
    VBAX Newbie
    Joined
    Oct 2012
    Posts
    1
    Location

    Copying Excel range to Word doesn't copy the image

    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:
    [VBA]
    ThisWorkBook.sheet("WorkOrder").Select
    Range("A1:J52").Copy
    wrdApp.Selection.PasteSpecial Link:=False, DataType:=Word.WdPasteDataType.wdPasteOLEObject, Placement:=wdInLine, DisplayAsIcon:=False
    [/VBA]
    Does anyone have any idea about what I could try? Has anyone ever heard of this before? Any help would be appreciated.

  2. #2
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    May be of no help, but could you zip the .doc(?), .xls(?) and image (of same type (.jpg, .bmp, etc)) ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •