<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Embed PDF file as OLE Object in Excel in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Embed-PDF-file-as-OLE-Object-in-Excel/m-p/118809#M52807</link>
    <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;I am trying to embed PDF as an OLE object in Excel via Blue Prism. Any leads would be helpful. Thanks in advance for your time and suggestions.&lt;/P&gt;&lt;P&gt;I am using regular Excel object to create instance, open workbook, activating required worksheet and then attempting to add PDF file using the below code but getting error as “Add method of OLEObjects class failed”&lt;/P&gt;&lt;P&gt;Tested with the ClassType:= “Acrobat.Document.DC” as well&lt;/P&gt;&lt;P&gt;Dim excelApp As Object&lt;/P&gt;&lt;P&gt;Dim workSheet As Object&lt;/P&gt;&lt;P&gt;Dim range As Object&lt;/P&gt;&lt;P&gt;Dim pdfPath As String&lt;/P&gt;&lt;P&gt;excelApp = GetInstance(Handle)&lt;/P&gt;&lt;P&gt;workSheet = excelApp.ActiveSheet&lt;/P&gt;&lt;P&gt;pdfPath = "C:\path\file.pdf"&lt;/P&gt;&lt;P&gt;range = workSheet.Range(“A1”)&lt;/P&gt;&lt;P&gt;workSheet.OLEObjects.Add( _&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ClassType:="AcroExch.Document", _&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileName:=pdfPath, _&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Link:=False, _&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DisplayAsIcon:=True, _&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IconLabel:="Embedded PDF")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
    <pubDate>Tue, 11 Feb 2025 19:52:56 GMT</pubDate>
    <dc:creator>RachanaA</dc:creator>
    <dc:date>2025-02-11T19:52:56Z</dc:date>
    <item>
      <title>Embed PDF file as OLE Object in Excel</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Embed-PDF-file-as-OLE-Object-in-Excel/m-p/118809#M52807</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;I am trying to embed PDF as an OLE object in Excel via Blue Prism. Any leads would be helpful. Thanks in advance for your time and suggestions.&lt;/P&gt;&lt;P&gt;I am using regular Excel object to create instance, open workbook, activating required worksheet and then attempting to add PDF file using the below code but getting error as “Add method of OLEObjects class failed”&lt;/P&gt;&lt;P&gt;Tested with the ClassType:= “Acrobat.Document.DC” as well&lt;/P&gt;&lt;P&gt;Dim excelApp As Object&lt;/P&gt;&lt;P&gt;Dim workSheet As Object&lt;/P&gt;&lt;P&gt;Dim range As Object&lt;/P&gt;&lt;P&gt;Dim pdfPath As String&lt;/P&gt;&lt;P&gt;excelApp = GetInstance(Handle)&lt;/P&gt;&lt;P&gt;workSheet = excelApp.ActiveSheet&lt;/P&gt;&lt;P&gt;pdfPath = "C:\path\file.pdf"&lt;/P&gt;&lt;P&gt;range = workSheet.Range(“A1”)&lt;/P&gt;&lt;P&gt;workSheet.OLEObjects.Add( _&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ClassType:="AcroExch.Document", _&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileName:=pdfPath, _&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Link:=False, _&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DisplayAsIcon:=True, _&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IconLabel:="Embedded PDF")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2025 19:52:56 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Embed-PDF-file-as-OLE-Object-in-Excel/m-p/118809#M52807</guid>
      <dc:creator>RachanaA</dc:creator>
      <dc:date>2025-02-11T19:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: Embed PDF file as OLE Object in Excel</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Embed-PDF-file-as-OLE-Object-in-Excel/m-p/118815#M52808</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/27406"&gt;@RachanaA&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You can try the following approach in a separate action page in your business object:&lt;/P&gt;&lt;P&gt;1) Create a business object named, '&lt;STRONG&gt;Insert PDF&lt;/STRONG&gt;' with following arguments:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="devneetmohanty07_0-1739310590272.png" style="width: 400px;"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/40381i29584842FA642D1E/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="devneetmohanty07_0-1739310590272.png" alt="devneetmohanty07_0-1739310590272.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Create a code stage with the following arguments and code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="devneetmohanty07_1-1739310623870.png" style="width: 400px;"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/40382i1ED185DF09789EE1/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="devneetmohanty07_1-1739310623870.png" alt="devneetmohanty07_1-1739310623870.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="devneetmohanty07_2-1739310630587.png" style="width: 400px;"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/40383iB5F96702F0705DFB/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="devneetmohanty07_2-1739310630587.png" alt="devneetmohanty07_2-1739310630587.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Dim wb, excel, range As Object

Try

wb = GetWorkbook(Handle, Workbook)
excel = wb.Application
excel.ActiveSheet.OLEObjects.Add(Filename:=PDFFilePath, Link:=False, DisplayAsIcon:=True, IconFileName:=PDFApplicationPath, IconIndex:=0, IconLabel:="Passport.pdf")

Success = True

Catch e As Exception
	Success = False
	Message = e.Message
Finally
	wb = Nothing
	excel = Nothing
	range = Nothing
End Try&lt;/LI-CODE&gt;&lt;P&gt;3) Your workflow should look something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="devneetmohanty07_3-1739310671765.png" style="width: 400px;"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/40384iDADFA1488E86E58E/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="devneetmohanty07_3-1739310671765.png" alt="devneetmohanty07_3-1739310671765.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;4) Pass the proper arguments for the PDF file path which is your actual file path and your adobe application path and it should work as you can see below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="devneetmohanty07_4-1739310739794.png" style="width: 400px;"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/40385i1962957EE640BDB2/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="devneetmohanty07_4-1739310739794.png" alt="devneetmohanty07_4-1739310739794.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if you have any further doubts. Thanks for posting your query in the community.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2025 21:52:54 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Embed-PDF-file-as-OLE-Object-in-Excel/m-p/118815#M52808</guid>
      <dc:creator>devneetmohanty07</dc:creator>
      <dc:date>2025-02-11T21:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: Embed PDF file as OLE Object in Excel</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Embed-PDF-file-as-OLE-Object-in-Excel/m-p/118816#M52809</link>
      <description>&lt;P&gt;&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/1843"&gt;@devneetmohanty07&lt;/a&gt;&amp;nbsp;Thank you so much. It worked.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2025 22:06:26 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Embed-PDF-file-as-OLE-Object-in-Excel/m-p/118816#M52809</guid>
      <dc:creator>RachanaA</dc:creator>
      <dc:date>2025-02-11T22:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Embed PDF file as OLE Object in Excel</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Embed-PDF-file-as-OLE-Object-in-Excel/m-p/119270#M52947</link>
      <description>&lt;P&gt;&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/1843"&gt;@devneetmohanty07&lt;/a&gt;&amp;nbsp;great, detailed response here. Thank you so much!&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/27406"&gt;@RachanaA&lt;/a&gt;&amp;nbsp;out of curiosity, what's the context behind this? Why do you need to embed a PDF in an Excel file?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Mar 2025 11:31:58 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Embed-PDF-file-as-OLE-Object-in-Excel/m-p/119270#M52947</guid>
      <dc:creator>Michael_S</dc:creator>
      <dc:date>2025-03-06T11:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Embed PDF file as OLE Object in Excel</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Embed-PDF-file-as-OLE-Object-in-Excel/m-p/119282#M52950</link>
      <description>&lt;P&gt;&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/15"&gt;@Michael_S&lt;/a&gt;&amp;nbsp;It is required for reporting purpose in our organization. An excel file is required to have the PDF as an object instead of hyperlink.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Mar 2025 18:16:45 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Embed-PDF-file-as-OLE-Object-in-Excel/m-p/119282#M52950</guid>
      <dc:creator>RachanaA</dc:creator>
      <dc:date>2025-03-06T18:16:45Z</dc:date>
    </item>
  </channel>
</rss>

