<?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 launch StoredProcess from VBA in Developers</title>
    <link>https://communities.sas.com/t5/Developers/launch-StoredProcess-from-VBA/m-p/1718#M1590</link>
    <description>we are trying to use sas Stored Processes from VBA with IOM interface:&lt;BR /&gt;
It seems to be ok but the password stored in metadata server is propagated and we don't want to store password in SAS Metadata.&lt;BR /&gt;
&lt;BR /&gt;
Here is an example :&lt;BR /&gt;
Dim obObjectFactory As New SASObjectManager.ObjectFactory&lt;BR /&gt;
Dim spManager As New SASStoredProcessService.Manager&lt;BR /&gt;
Dim spInstance As SASStoredProcessService.Instance&lt;BR /&gt;
Dim spExecution As SASStoredProcessService.Execution&lt;BR /&gt;
Dim spReader As SASStoredProcessService.StreamReader&lt;BR /&gt;
obObjectFactory.SetMetadataFile "C:\Test\VBA\oms_serverinfo.xml", "", False&lt;BR /&gt;
&lt;BR /&gt;
....and so on&lt;BR /&gt;
&lt;BR /&gt;
3 questions : &lt;BR /&gt;
-where is the complete documentation ?&lt;BR /&gt;
-is IOM the best way to execute STP from VBA ?&lt;BR /&gt;
-If yes, it is possible to force IOM objets to use the password write in the configuration file ? For the moment this password is used only for connection to metadata server. After that,the wrong password stored in metadata is propagated.... &lt;BR /&gt;
&lt;BR /&gt;
BR&lt;BR /&gt;
&lt;BR /&gt;
Greg</description>
    <pubDate>Mon, 06 Nov 2006 13:38:09 GMT</pubDate>
    <dc:creator>Greg</dc:creator>
    <dc:date>2006-11-06T13:38:09Z</dc:date>
    <item>
      <title>launch StoredProcess from VBA</title>
      <link>https://communities.sas.com/t5/Developers/launch-StoredProcess-from-VBA/m-p/1718#M1590</link>
      <description>we are trying to use sas Stored Processes from VBA with IOM interface:&lt;BR /&gt;
It seems to be ok but the password stored in metadata server is propagated and we don't want to store password in SAS Metadata.&lt;BR /&gt;
&lt;BR /&gt;
Here is an example :&lt;BR /&gt;
Dim obObjectFactory As New SASObjectManager.ObjectFactory&lt;BR /&gt;
Dim spManager As New SASStoredProcessService.Manager&lt;BR /&gt;
Dim spInstance As SASStoredProcessService.Instance&lt;BR /&gt;
Dim spExecution As SASStoredProcessService.Execution&lt;BR /&gt;
Dim spReader As SASStoredProcessService.StreamReader&lt;BR /&gt;
obObjectFactory.SetMetadataFile "C:\Test\VBA\oms_serverinfo.xml", "", False&lt;BR /&gt;
&lt;BR /&gt;
....and so on&lt;BR /&gt;
&lt;BR /&gt;
3 questions : &lt;BR /&gt;
-where is the complete documentation ?&lt;BR /&gt;
-is IOM the best way to execute STP from VBA ?&lt;BR /&gt;
-If yes, it is possible to force IOM objets to use the password write in the configuration file ? For the moment this password is used only for connection to metadata server. After that,the wrong password stored in metadata is propagated.... &lt;BR /&gt;
&lt;BR /&gt;
BR&lt;BR /&gt;
&lt;BR /&gt;
Greg</description>
      <pubDate>Mon, 06 Nov 2006 13:38:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/launch-StoredProcess-from-VBA/m-p/1718#M1590</guid>
      <dc:creator>Greg</dc:creator>
      <dc:date>2006-11-06T13:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: launch StoredProcess from VBA</title>
      <link>https://communities.sas.com/t5/Developers/launch-StoredProcess-from-VBA/m-p/1719#M1591</link>
      <description>The experimental COM API is used internally by SAS applications -- you can use it at your own risk.  In SAS 9.2 we plan to formally release a .NET API that will be documented and supported.&lt;BR /&gt;
&lt;BR /&gt;
One thing you can do with VBA is try the techniques described in this paper:&lt;BR /&gt;
&lt;BR /&gt;
Techniques for SAS-Enabling Microsoft Office in a Cross-Platform Environment&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi27/p174-27.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi27/p174-27.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Some of the information is dated, but you may find the section on VBA helpful.  The paper uses SAS/IntrNet as an example, but it can be extended to SAS Stored Processes because they are basically "The Son of SAS/IntrNet"(tm).&lt;BR /&gt;
&lt;BR /&gt;
For example, this Excel macro, adapted from the paper (only changed the URL), runs the "Hello World" stored process sample and inserts the output into the current worksheet.&lt;PRE&gt;Sub insertHTML()&lt;BR /&gt;
Dim currentCell As Range&lt;BR /&gt;
Dim tempWorkbook As Workbook&lt;BR /&gt;
Dim tempRange As Range&lt;BR /&gt;
Set currentCell = Application.Workbooks(ActiveWorkbook.Name).ActiveSheet.Application.ActiveCell&lt;BR /&gt;
Set tempWorkbook = Workbooks.Open("http://&lt;I&gt;your-server:your-port&lt;/I&gt;/SASStoredProcess/do?_PROGRAM=/Samples/Stored Processes/Sample: Hello World")&lt;BR /&gt;
Set tempRange = tempWorkbook.ActiveSheet.UsedRange&lt;BR /&gt;
tempRange.Copy currentCell&lt;BR /&gt;
tempWorkbook.Close False&lt;BR /&gt;
End Sub&lt;/PRE&gt;You will get prompted for a username and password in order to run the stored process.  It look like Excel caches this information, so you should only have to enter it for the first stored process that you execute in a given workbook.&lt;BR /&gt;
&lt;BR /&gt;
Documentation for the SAS Stored Process Web Application is at:&lt;BR /&gt;
&lt;A href="http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/stpwebapp.html" target="_blank"&gt;http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/stpwebapp.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Excel Web Queries, also discussed in the paper, are something else you should probably evaluate.&lt;BR /&gt;
&lt;BR /&gt;
Vince&lt;BR /&gt;
SAS R&amp;amp;D</description>
      <pubDate>Wed, 31 Jan 2007 18:02:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/launch-StoredProcess-from-VBA/m-p/1719#M1591</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2007-01-31T18:02:39Z</dc:date>
    </item>
  </channel>
</rss>

