<?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 Object in Excel using OLE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/embed-object-in-excel-using-ole/m-p/11793204#M1953483</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to embed an object inside excel and it is not working.&lt;/P&gt;&lt;P&gt;PFB VB and ABAP code used for it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;VB Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ActiveSheet.OLEObjects.Add(Filename:= &amp;lt;filepath&amp;gt;, Link:=False, DisplayAsIcon:=False).Select&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;ABAP Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GET PROPERTY OF lo_worksheet 'OLEObjects' = lo_object.&lt;/P&gt;&lt;P&gt;CALL METHOD OF lo_object 'Add'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; EXPORTING&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #1&amp;nbsp;&amp;nbsp;&amp;nbsp; = &amp;lt;filepath&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #2&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #3&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have passed #2 and #3 as 0, 1 , 2 , '0', '1', '2' and it is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me out!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Aug 2016 12:08:46 GMT</pubDate>
    <dc:creator>rajad</dc:creator>
    <dc:date>2016-08-19T12:08:46Z</dc:date>
    <item>
      <title>Embed Object in Excel using OLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/embed-object-in-excel-using-ole/m-p/11793204#M1953483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to embed an object inside excel and it is not working.&lt;/P&gt;&lt;P&gt;PFB VB and ABAP code used for it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;VB Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ActiveSheet.OLEObjects.Add(Filename:= &amp;lt;filepath&amp;gt;, Link:=False, DisplayAsIcon:=False).Select&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;ABAP Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GET PROPERTY OF lo_worksheet 'OLEObjects' = lo_object.&lt;/P&gt;&lt;P&gt;CALL METHOD OF lo_object 'Add'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; EXPORTING&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #1&amp;nbsp;&amp;nbsp;&amp;nbsp; = &amp;lt;filepath&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #2&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #3&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have passed #2 and #3 as 0, 1 , 2 , '0', '1', '2' and it is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me out!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2016 12:08:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/embed-object-in-excel-using-ole/m-p/11793204#M1953483</guid>
      <dc:creator>rajad</dc:creator>
      <dc:date>2016-08-19T12:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Embed Object in Excel using OLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/embed-object-in-excel-using-ole/m-p/11793205#M1953484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have a look at its definition, in the VBA object explorer (F2), you'll see that filename, link, displayAsIcon are respectively the parameters number 2, 3 and 4 (Function Add([ClassType], [Filename], [Link], [DisplayAsIcon], [IconFileName], [IconIndex], [IconLabel], [Left], [Top], [Width], [Height]) As OLEObject)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2016 13:38:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/embed-object-in-excel-using-ole/m-p/11793205#M1953484</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2016-08-19T13:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: Embed Object in Excel using OLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/embed-object-in-excel-using-ole/m-p/11793206#M1953485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sandra Rossi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response!&lt;/P&gt;&lt;P&gt;Even when I pass them as #2 #3 #4, it is not embedding.&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;CALL METHOD OF lo_object 'Add'&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; EXPORTING&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #2&amp;nbsp;&amp;nbsp;&amp;nbsp; = &amp;lt;filepath&amp;gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #3&amp;nbsp;&amp;nbsp; = 0&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #4&amp;nbsp;&amp;nbsp; = 0.&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;Anything else that I am missing?&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;Thanks,&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2016 17:17:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/embed-object-in-excel-using-ole/m-p/11793206#M1953485</guid>
      <dc:creator>rajad</dc:creator>
      <dc:date>2016-08-19T17:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: Embed Object in Excel using OLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/embed-object-in-excel-using-ole/m-p/11793207#M1953486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I could reproduce the issue, and couldn't find a way to work around the issue using OLE. So, the only way to call OLEobjects.add is to convert the whole code into VBscript, and call it via DOI (method EXECUTE_MACRO of I_OI_SCRIPT_COLLECTION - search the forum and the SAP library Desktop Office Integration).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: 0 for false, and 1 for true are correct assumptions. Moreover, I did tests with another method whose first parameter was optional, and I noticed that doing "worksheet.checkSpelling ,true" (second parameter "ignoreUpperCase") with only EXPORTING #2 = 1 was unsufficient, it was working only with EXPORTING #1 = '' #2 = 1. So, I came to the conclusion that all first parameters are to be passed, even if not used, which means that OLEobjects.add may never work because OLEobjects.add '', 'filepath', false, false fails in VBA (the first parameter ClassType must not be passed).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Aug 2016 20:07:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/embed-object-in-excel-using-ole/m-p/11793207#M1953486</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2016-08-20T20:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: Embed Object in Excel using OLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/embed-object-in-excel-using-ole/m-p/11793208#M1953487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To execute VBscript, instead of DOI, you may try the trick by &lt;A __default_attr="413503" __jive_macro_name="user" class="jive_macro_user jive_macro" data-objecttype="3" data-orig-content="Stefan Schnell" href="https://community.sap.com/"&gt;&lt;/A&gt; (&lt;A __default_attr="146500" __jive_macro_name="blogpost" class="jive_macro jive_macro_blogpost" data-orig-content="How To Use VBA Recorded Code in ABAP" href="https://community.sap.com/"&gt;&lt;/A&gt;) :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt; &lt;SPAN style="font-family: Courier New;"&gt;Create Object oScript 'MSScriptControl.ScriptControl'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Check sy-subrc = 0 And oScript-Handle &amp;gt; 0 And oScript-Type = 'OLE2'.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "-Allow to display UI elements--------------------------------------&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set Property Of oScript 'AllowUI' = 1.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "-Intialize the VBScript language-----------------------------------&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set Property Of oScript 'Language' = 'VBScript'.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "-Intialize VBCode here---------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'courier new', courier;"&gt; VBCode = 'line1' &amp;amp;&amp;amp; 'line2' &amp;amp;&amp;amp; 'line3'...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'courier new', courier;"&gt; ...&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "-Execute VBScript code---------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call Method Of oScript 'ExecuteStatement' Exporting #1 = VBCode.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "-Free the object---------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Free Object oScript.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Aug 2016 15:32:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/embed-object-in-excel-using-ole/m-p/11793208#M1953487</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2016-08-21T15:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Embed Object in Excel using OLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/embed-object-in-excel-using-ole/m-p/11793209#M1953488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your suggestion Sandra Rossi!&lt;/P&gt;&lt;P&gt;I will try the above one and confirm you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Aug 2016 15:59:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/embed-object-in-excel-using-ole/m-p/11793209#M1953488</guid>
      <dc:creator>rajad</dc:creator>
      <dc:date>2016-08-21T15:59:22Z</dc:date>
    </item>
  </channel>
</rss>

