<?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 Facing problem when trying to execute Excel macro in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/facing-problem-when-trying-to-execute-excel-macro/m-p/2367905#M524439</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm currently opening an Excel document stored within BDS and am trying to populate certain fields before running a macro. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I was previously using OLE objects to do this, I managed to do this as well as run the macro which was responsible to print a relevant sheet in Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, as I'm now required to read the document from BDS, I'm using the I_OI_DOCUMENT_PROXY class to run the Excel macro. I've tried using the EXECUTE_MACRO method but I keep getting the error 'MACRO_OR_SCRIPT_FAILED'. Does anyone know what's the cause of this and how do I go about solving this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Adeline.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 16 Jun 2007 14:54:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-16T14:54:04Z</dc:date>
    <item>
      <title>Facing problem when trying to execute Excel macro</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/facing-problem-when-trying-to-execute-excel-macro/m-p/2367905#M524439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm currently opening an Excel document stored within BDS and am trying to populate certain fields before running a macro. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I was previously using OLE objects to do this, I managed to do this as well as run the macro which was responsible to print a relevant sheet in Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, as I'm now required to read the document from BDS, I'm using the I_OI_DOCUMENT_PROXY class to run the Excel macro. I've tried using the EXECUTE_MACRO method but I keep getting the error 'MACRO_OR_SCRIPT_FAILED'. Does anyone know what's the cause of this and how do I go about solving this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Adeline.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Jun 2007 14:54:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/facing-problem-when-trying-to-execute-excel-macro/m-p/2367905#M524439</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-16T14:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: Facing problem when trying to execute Excel macro</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/facing-problem-when-trying-to-execute-excel-macro/m-p/2367906#M524440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I finally managed to figure this out. As the macro was created within a module, when calling the EXECUTE_MACRO method, the module name would have to be specified first, followed by the actual macro name. Below is an example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: doc TYPE REF TO i_oi_document_proxy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD doc-&amp;gt;execute_macro&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    macro_string = 'ModPrint.PrintCard'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where ModPrint is the module and PrintCard is the macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Adeline.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 07:48:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/facing-problem-when-trying-to-execute-excel-macro/m-p/2367906#M524440</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-20T07:48:15Z</dc:date>
    </item>
  </channel>
</rss>

