+ Reply to Thread
Results 1 to 2 of 2

Copy and paste images from excel to word with VBA

  1. #1
    Registered User
    Join Date
    10-09-2019
    Location
    Udine, Italia
    MS-Off Ver
    360
    Posts
    2

    Copy and paste images from excel to word with VBA

    Goodmorning

    I'm writing a macro to copy images from an Excel sheet to a specific Word file (in my case, "Pippo2").
    This macro look if the word file is open and, if not, the macro do it.
    My problem is that when I paste more than one image, the new one overwrites the previous, but I would like to have all the images one under the other. Someone could help me?

    Here my code:

    Dim xPic As Picture
    Dim WordApp As Object



    Sub sposta()


    For Each xPic In ActiveSheet.Pictures
    xPic.Select
    Selection.Copy


    On Error Resume Next
    Set WordApp = GetObject(, "Word.application") 'gives error 429 if Word is not open
    If Err = 429 Then
    Set WordApp = CreateObject("Word.application") 'creates a Word application
    Err.Clear
    End If

    fileword = "C:\Users\szuttion\Desktop\Pippo2.docx"
    WordApp.Visible = True
    If fileword = "False" Then Exit Sub
    With WordApp.Documents.Open(fileword)
    .Content.InsertAfter vbCr
    .Range.Paste


    End With


    Set WordApp = Nothing

    Next
    End Sub


    PS: sorry for my english, it's not my motherlanguage

  2. #2
    Registered User
    Join Date
    10-09-2019
    Location
    Udine, Italia
    MS-Off Ver
    360
    Posts
    2

    Re: Copy and paste images from excel to word with VBA

    Because of it's long time I have this problem, time ago I posted on another forum with no success. I'm not allowed to post the link.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Cycle through copy pasting images from Word into Excel?
    By russwongg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-18-2019, 05:39 AM
  2. copy images and text from Word to Excel
    By gregorym in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-05-2016, 07:59 AM
  3. copy images and text from Word to Excel
    By gregorym in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-05-2016, 07:54 AM
  4. copy images from Word to excel
    By gregorym in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-04-2016, 07:44 AM
  5. Copy images from a folder & paste them in Excel
    By karan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-22-2011, 02:40 PM
  6. How to copy images from word to excel 2003
    By anilkumar.n in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-19-2009, 08:56 AM
  7. Excel charts copy / paste crops the images
    By Neil J Mansfield in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 04-10-2006, 11:55 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1