VBA - copy from Excel to Word as Picture

PlenkY94

New Member
Joined
Jul 13, 2022
Messages
4
Office Version
  1. 2021
Platform
  1. Windows
Hey guys!

Is there a way to copy certain range of excel and paste it to word but as a picture?

I have a excel document with a lot of data that should be copied and pasted to Word document but pasted as a picture. I could manage to write a code that copy the cells to word but is it possible to paste it as a picture?

Also, the Word document is a template I use. Will there be a problem with the code for pasting if I change the name of the Word file?

Cheers.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Welcome to the board.
The CopyPicture method would help.
I think it would be necessary to use Word macros to adjust the pasting position on the Word side. An easy one is using a Bookmarks object. (I guess)
Here is a sample to paste an Excel range as a picture to a Word document.

VBA Code:
Sub CopyPictureSamp1()
    Dim WordApp As Object

    'Preparation a Word Object
    On Error Resume Next
    Set WordApp = GetObject(Class:="Word.Application")
    On Error GoTo 0
    If WordApp Is Nothing Then
        Set WordApp = CreateObject("Word.Application")
    End If
    WordApp.Visible = True

    'Copy picture
    Range("B1:G12").CopyPicture _
            Appearance:=xlScreen, Format:=xlPicture

    'Change here to suit your needs
    WordApp.Documents.Open Filename:="C:\temp\Sample.docx"
    WordApp.Selection.Paste
End Sub
 
Upvote 0
Thank you for your reply!

Now when I think about it, it's probably better if I write Macro in Word document. Do you have an idea how to go to specific Excel file, copy range form it and then paste it into Word?
 
Upvote 0

Forum statistics

Threads
1,215,453
Messages
6,124,930
Members
449,195
Latest member
Stevenciu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top