<?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 Importing Excel Object to Word Document in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Importing-Excel-Object-to-Word-Document/m-p/79824#M31656</link>
    <description>HI,
 I want to import MS Excel Object at the End of Word Document but there seems there is no BP defined object for this. Please let me know:
1) is there any VBO which can help me to import an Excel object to MS Word document?

I tried to code and run but I am getting below exception:

Internal: Could not execute code stage because the exception is thrown by code stage: Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))

Please help or guide me. How can I achieve this?

Here is the Code I am trying :

Dim d As Object = GetDocument(handle,document_name)
Dim w As Object = d.Application
Dim r As Object = d.Range

Dim ConfirmConversions As Object = False
Dim Link As Object = False
Dim Attachment As Object = True

d.Bookmarks.Add("Page_End",r)
if d.Bookmarks.Exists("Page_End")
'Dim Direction As Object = w.Selection.Collapse
'w.Selection.InsertFile(attaching_file, "Page_End", True, True, False)
w.Selection.InsertFile(attaching_file, r, ConfirmConversions, Link, Attachment)
end if
d = Nothing
w = Nothing</description>
    <pubDate>Wed, 05 Jul 2017 22:43:00 GMT</pubDate>
    <dc:creator>SUMEETMANGLESH</dc:creator>
    <dc:date>2017-07-05T22:43:00Z</dc:date>
    <item>
      <title>Importing Excel Object to Word Document</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Importing-Excel-Object-to-Word-Document/m-p/79824#M31656</link>
      <description>HI,
 I want to import MS Excel Object at the End of Word Document but there seems there is no BP defined object for this. Please let me know:
1) is there any VBO which can help me to import an Excel object to MS Word document?

I tried to code and run but I am getting below exception:

Internal: Could not execute code stage because the exception is thrown by code stage: Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))

Please help or guide me. How can I achieve this?

Here is the Code I am trying :

Dim d As Object = GetDocument(handle,document_name)
Dim w As Object = d.Application
Dim r As Object = d.Range

Dim ConfirmConversions As Object = False
Dim Link As Object = False
Dim Attachment As Object = True

d.Bookmarks.Add("Page_End",r)
if d.Bookmarks.Exists("Page_End")
'Dim Direction As Object = w.Selection.Collapse
'w.Selection.InsertFile(attaching_file, "Page_End", True, True, False)
w.Selection.InsertFile(attaching_file, r, ConfirmConversions, Link, Attachment)
end if
d = Nothing
w = Nothing</description>
      <pubDate>Wed, 05 Jul 2017 22:43:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Importing-Excel-Object-to-Word-Document/m-p/79824#M31656</guid>
      <dc:creator>SUMEETMANGLESH</dc:creator>
      <dc:date>2017-07-05T22:43:00Z</dc:date>
    </item>
    <item>
      <title>RE: Importing Excel Object to Word Document</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Importing-Excel-Object-to-Word-Document/m-p/79825#M31657</link>
      <description>Hi Sumeet,&lt;BR /&gt;&lt;BR /&gt;The big question is your excel file is in csv? or xlsx? If it is separated by different columns seperated by comma (so it's in fact a CSV) .&lt;BR /&gt;&lt;BR /&gt;Have you tried object Utility - File Management with the action Read All Text from File or Get CSV Text As Collection if it is CSV. You can install Excel VBO too, &lt;A href="https://digitalexchange.blueprism.com/dx/entry/3439/solution/ms-excel-blue-prism-utility" target="test_blank"&gt;https://digitalexchange.blueprism.com/dx/entry/3439/solution/ms-excel-blue-prism-utility&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt; Regarding the word file: The question applies: What content you plan to copy to? Transfer the tables from the excel document to an word file, or just copy paste the text? &lt;BR /&gt;if it is just copy the text from Excel and paste to Word, it should be relatively easy. You can install Word VBO, &lt;A href="https://digitalexchange.blueprism.com/dx/entry/3439/solution/ms-word-blue-prism-utility" target="test_blank"&gt;https://digitalexchange.blueprism.com/dx/entry/3439/solution/ms-word-blue-prism-utility&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;- Use the 'Select' action of MS Excel VBO to highlight all your data that needs to be copied&lt;BR /&gt;- 'Copy' action&lt;BR /&gt;- 'Create instance' of the Word document (this can also be done at the beginning of the process)&lt;BR /&gt;- 'Open'&lt;BR /&gt;- 'Show' (optional)&lt;BR /&gt;- 'Paste from Clipboard' action of MS Word VBO&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;In Joe&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;In Joe Khor&lt;BR /&gt;Sr. Product Consultant&lt;BR /&gt;Blue Prism&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 02 Jul 2020 16:05:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Importing-Excel-Object-to-Word-Document/m-p/79825#M31657</guid>
      <dc:creator>InJoeKhor</dc:creator>
      <dc:date>2020-07-02T16:05:00Z</dc:date>
    </item>
  </channel>
</rss>

