<?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 Re: How to use the Function $Application_Run() defined in file  in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885822#M76654</link>
    <description>&lt;P&gt;Thanks for kooka's suggestion and Lionel'sresponse : )&lt;/P&gt;
&lt;P&gt;By the way, the version of excel I used is Excel 2003, and the function also works for Excel 2002. &lt;/P&gt;</description>
    <pubDate>Sat, 20 Sep 2008 02:04:06 GMT</pubDate>
    <dc:creator>cyfeng</dc:creator>
    <dc:date>2008-09-20T02:04:06Z</dc:date>
    <item>
      <title>How to use the Function $Application_Run() defined in file "Excel.f90"</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885812#M76644</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;
&lt;P&gt;Recently, I tried the example: "AutoDice" in the compiler directory "SAMPLESCOM" andfound thereis a complete moduleEXCEL defined in "Excel.f90". &lt;/P&gt;
&lt;P&gt;Since the module contains the Automation interfaces of the EXCEL, may I use the Function $Application_Run($OBJECT, Macro,Arg1, Arg2,..., $STATUS) to executea macro pre-defined in an excel file ? &lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Sep 2008 03:45:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885812#M76644</guid>
      <dc:creator>cyfeng</dc:creator>
      <dc:date>2008-09-16T03:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Function $Application_Run() defined in file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885813#M76645</link>
      <description>&lt;P&gt;Yes, you can use this function to run an Excel Macro.&lt;/P&gt;
&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Tue, 16 Sep 2008 13:01:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885813#M76645</guid>
      <dc:creator>Michael8</dc:creator>
      <dc:date>2008-09-16T13:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Function $Application_Run() defined in file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885814#M76646</link>
      <description>&lt;P&gt;Thank you, Michael. : )&lt;/P&gt;
&lt;P&gt;As the argument 'Macro' defined in the $Application_Run($Object, Macro, Arg1, ..., $Status) is declared as TYPE(Variant), how should I passthe information of certain EXCEL Macro correctly into it?&lt;/P&gt;
&lt;P&gt;For example, ifthere was amacro named asSHOWdefined in UH.xls Module1,is the following way assigning infomation into argument Macro correct?&lt;/P&gt;
&lt;P&gt;Thank you again.&lt;/P&gt;
&lt;P&gt;
&lt;/P&gt;&lt;HR /&gt;

&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;CALL VariantInit(CRO)&lt;/PRE&gt;&lt;PRE&gt;CRO%VT = VT_BSTR&lt;/PRE&gt;&lt;PRE&gt;CRO%VU%PTR_VAL = ConvertStringToBSTR('UH.xls!Module1.SHOW')&lt;/PRE&gt;&lt;PRE&gt;TEST = $Application_Run(workbook, Macro=CRO, $STATUS=STATUS)&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Sep 2008 03:58:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885814#M76646</guid>
      <dc:creator>cyfeng</dc:creator>
      <dc:date>2008-09-17T03:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Function $Application_Run() defined in file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885815#M76647</link>
      <description>&lt;P&gt;My post wasn't purposely trying to be facetious, I just wasn't sure exactly what your question was getting at. Your second post clarifies your question.&lt;/P&gt;
&lt;P&gt;I'm no expert on this stuff, but I've gotten it to work, so I can tell you how I did it -- that'snot to say other ways are wrong.&lt;/P&gt;
&lt;P&gt;Adapting from your example, I would just do the following:&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#0000ff" size="2"&gt;&lt;P&gt;TEST = $Application_Run(excelapp, 'SHOW', $STATUS=STATUS)&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;Notice that the first argument I pass in is excellapp, not workbook. But since I have the workbook open and active in the Excel application, I don't need to tell it where to find the macro (by using 'UH.xls!Module1').&lt;/P&gt;
&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Wed, 17 Sep 2008 15:13:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885815#M76647</guid>
      <dc:creator>Michael8</dc:creator>
      <dc:date>2008-09-17T15:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Function $Application_Run() defined in file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885816#M76648</link>
      <description>&lt;P&gt;Hi, Michael.&lt;/P&gt;
&lt;P&gt;Thank you very much.&lt;/P&gt;
&lt;P&gt;I tried the way you suggested. &lt;/P&gt;
&lt;P&gt;However, the Fortran Compiler 10.1.021 threw the following message:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000"&gt;Error: The type of the actual argument differs from the type of the dummy argument. ['SHOW']&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Is there any function convert the string to variant?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Sep 2008 15:33:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885816#M76648</guid>
      <dc:creator>cyfeng</dc:creator>
      <dc:date>2008-09-17T15:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Function $Application_Run() defined in file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885817#M76649</link>
      <description>&lt;P&gt;Sorry about that. (I hate posting code without actually testing it first...)&lt;/P&gt;
&lt;P&gt;What I should have said was that you should convert the string as you had done, using ConvertStringToBSTR, but just use 'SHOW' instead of 'UL.xls!Module1!Show'.&lt;/P&gt;
&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Wed, 17 Sep 2008 15:51:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885817#M76649</guid>
      <dc:creator>Michael8</dc:creator>
      <dc:date>2008-09-17T15:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Function $Application_Run() defined in file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885818#M76650</link>
      <description>&lt;P&gt;It works!&lt;/P&gt;
&lt;P&gt;Michael, thank you very much. :D&lt;/P&gt;</description>
      <pubDate>Wed, 17 Sep 2008 16:09:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885818#M76650</guid>
      <dc:creator>cyfeng</dc:creator>
      <dc:date>2008-09-17T16:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Function $Application_Run() defined in file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885819#M76651</link>
      <description>&lt;P&gt;Great! I'm glad to hear it.&lt;/P&gt;
&lt;P&gt;Thanks for letting me know.&lt;BR /&gt;Michael&lt;/P&gt;</description>
      <pubDate>Wed, 17 Sep 2008 16:13:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885819#M76651</guid>
      <dc:creator>Michael8</dc:creator>
      <dc:date>2008-09-17T16:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Function $Application_Run() defined in file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885820#M76652</link>
      <description>i didn't read all the posts in this topic, but I think the dice example is made for excel 97, so you need to use the fortran module wizard to extract function interfaces to the version of excel you are using for a better performance, I recomend you to read the excel programing part in the msdn so you can take advanteges of all the functions you can use via com automation. &lt;A href="http://msdn.microsoft.com/en-us/library/bb979621.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb979621.aspx&lt;/A&gt;</description>
      <pubDate>Wed, 17 Sep 2008 20:43:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885820#M76652</guid>
      <dc:creator>kooka</dc:creator>
      <dc:date>2008-09-17T20:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Function $Application_Run() defined in file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885821#M76653</link>
      <description>The AUTODICE sample uses the COM interfaces from EXCEL97 but it seems to work fine with later versions of Excel.&lt;BR /&gt;</description>
      <pubDate>Wed, 17 Sep 2008 21:05:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885821#M76653</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2008-09-17T21:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Function $Application_Run() defined in file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885822#M76654</link>
      <description>&lt;P&gt;Thanks for kooka's suggestion and Lionel'sresponse : )&lt;/P&gt;
&lt;P&gt;By the way, the version of excel I used is Excel 2003, and the function also works for Excel 2002. &lt;/P&gt;</description>
      <pubDate>Sat, 20 Sep 2008 02:04:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-the-Function-Application-Run-defined-in-file-quot/m-p/885822#M76654</guid>
      <dc:creator>cyfeng</dc:creator>
      <dc:date>2008-09-20T02:04:06Z</dc:date>
    </item>
  </channel>
</rss>

