• 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.

Trying To Post A Range As Picture But It Keeps Removing Content Previously On Document

oidamae

New Member
Hey guys,

So I am trying to copy a range from an excel sheet and paste it as a picture in another word document. The issue is, I already have a picture on that document. I was wondering how I can copy paste without losing the picture I already had on the word document. I have attached my code.

>>> use code - tags <<<
Code:
Option Explicit
Dim ws1 As Worksheet
Dim DailyReportrange As Range
Dim wordapp As Object 'Word.Application'
Dim worddoc As Variant 'Word.Document'
Dim wordrange As Range

Sub DailyReport()
    Set ws1 = ActiveWorkbook.Worksheets("Sheet4")
    Set DailyReportrange = ws1.Range("A2:Q40")
    'Copy Daily Report'
    DailyReportrange.Copy
    'Open Word Document'
    Set wordapp = CreateObject("Word.Application")
    wordapp.Visible = True   
    Set worddoc = wordapp.Documents.Open("C:\Desktop\Ken Tobiko\Project\DocKenya.docx")
    worddoc.Range.PasteSpecial Link:=False, DataType:=wdPasteEnhancedMetafile, Placement:=wdInLine, DisplayAsIcon:=False 
End Sub
 
Last edited by a moderator:
Please describe in more detail : "I was wondering how I can copy paste without losing the picture I already had on the word document. "

What is happening to the existing picture ? What are you naming both pictures ? Is the existing picture simply moving to the second page ?

What are your best thought of what is happening to the existing picture ?
 
Please describe in more detail : "I was wondering how I can copy paste without losing the picture I already had on the word document. "

What is happening to the existing picture ? What are you naming both pictures ? Is the existing picture simply moving to the second page ?

What are your best thought of what is happening to the existing picture ?

Hi. The pictures on the document are actually buttons that I use to copy links onto. So when I paste from excel, the buttons completely disappear and only the pasted content remains on the page. I have not named any of the buttons nor the pasted range from excel. I have attached the original document.
 

Attachments

  • DocKenya.docx
    29.2 KB · Views: 1
If I understand correctly, you are copying from Excel (data, button images with links, etc) ... then pasting into Word ?

I was able to copy the button (including the links) and data from Excel then paste into Word. Once in Word, holding down CTRL
while clicking on the button image opened the attached link.

???
 
Back
Top