In an Excel vba script I try to copy a picture from Excel and paste it in my Word header with the following code:
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.documents.Add
Set WRng = objDoc.Sections(1).Headers(wdHeaderFooterPrimary).Range
WRng.Text = "Hello" // Displays properly Hello in the header
Worksheets("Logos").Shapes("LogoToCopy").Copy
WRng.Paste // Server threw exception error
However I receive a Run-time error '-2147417851', The server threw an exception.
Copy/pasting a text works fine. Any idea how to copy an image from excel and to paste it in a Word header using VBA in Excel ? Thanks.