OLE from Excel to OLE to Word

Bhuwan

New Member
Joined
Nov 11, 2014
Messages
1
I have an excel file which I use to create Word documents.
I am able to copy data, table, images.
However I have a PDF file in my excel file(which I have inserted using Insert option). I want that to Insert in the word document that I create.
Currently I am trying to use the following Code for this, BUT GETTING Error 4198 while executing. Could someone help please.

Code:
oDoc.Shapes.AddOLEObject ClassType:="AcroExch.Document.11", _
                                        Filename:= _
                                        ThisWorkbook.Worksheets("ABCD").OLEObjects("AAAA") _
                                        , LinkToFile:=False, DisplayAsIcon:=True, IconFileName:= _
                                        "C:\Windows\Installer\{AC76BA86-7AD7-1033-7B44-AB0000000001}\PDFFile_8.ico" _
                                        , IconIndex:=0, IconLabel:= _
                                        "AAAA"
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,215,346
Messages
6,124,417
Members
449,157
Latest member
mytux

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