<?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: running EG projecvt using VBscript in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/running-EG-projecvt-using-VBscript/m-p/594101#M34814</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am having the same issue where you able to resolve it?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Stephanie&lt;/P&gt;</description>
    <pubDate>Fri, 04 Oct 2019 13:51:19 GMT</pubDate>
    <dc:creator>SteUpenn</dc:creator>
    <dc:date>2019-10-04T13:51:19Z</dc:date>
    <item>
      <title>running EG projecvt using VBscript</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/running-EG-projecvt-using-VBscript/m-p/4447#M1408</link>
      <description>Hello, everybody. Sorry for my terrible english in advance. I hope, you'll help find me find out, what am i doing wrong)&lt;BR /&gt;
&lt;BR /&gt;
I have a project, which i want to run by schedule. EG created default VBscript (Tools-&amp;gt;Schedule Project how it was written in manual).&lt;BR /&gt;
&lt;BR /&gt;
&lt;I&gt;Option Explicit&lt;BR /&gt;
Dim app&lt;BR /&gt;
&lt;BR /&gt;
Call dowork&lt;BR /&gt;
&lt;BR /&gt;
'shut down the app&lt;BR /&gt;
If not (app Is Nothing) Then&lt;BR /&gt;
    app.Quit&lt;BR /&gt;
    Set app = Nothing&lt;BR /&gt;
End If&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Sub dowork()&lt;BR /&gt;
    On Error Resume Next&lt;BR /&gt;
    '----&lt;BR /&gt;
    ' Start up Enterprise Guide using the project name&lt;BR /&gt;
    '----&lt;BR /&gt;
    Dim prjName&lt;BR /&gt;
    Dim prjObject&lt;BR /&gt;
&lt;BR /&gt;
    prjName = "C:\SAS\sending_test.egp"    'Project Name&lt;BR /&gt;
      &lt;BR /&gt;
    Set app = CreateObject("SASEGObjectModel.Application.4")&lt;BR /&gt;
    If Checkerror("CreateObject") = True Then&lt;BR /&gt;
        Exit Sub&lt;BR /&gt;
    End If&lt;BR /&gt;
    &lt;BR /&gt;
    '-----&lt;BR /&gt;
    ' open the project&lt;BR /&gt;
    '-----&lt;BR /&gt;
    Set prjObject = app.Open(prjName,"")&lt;BR /&gt;
    If Checkerror("app.Open") = True Then&lt;BR /&gt;
        Exit Sub&lt;BR /&gt;
    End If&lt;BR /&gt;
    &lt;BR /&gt;
        &lt;BR /&gt;
    '-----&lt;BR /&gt;
    ' run the project&lt;BR /&gt;
    '-----&lt;BR /&gt;
    prjObject.run&lt;BR /&gt;
    If Checkerror("Project.run") = True Then&lt;BR /&gt;
        Exit Sub&lt;BR /&gt;
    End If&lt;BR /&gt;
    &lt;BR /&gt;
            &lt;BR /&gt;
    '-----&lt;BR /&gt;
    ' Save the new project&lt;BR /&gt;
    '-----&lt;BR /&gt;
    prjObject.Save&lt;BR /&gt;
    If Checkerror("Project.Save") = True Then&lt;BR /&gt;
        Exit Sub&lt;BR /&gt;
    End If&lt;BR /&gt;
    &lt;BR /&gt;
    '-----&lt;BR /&gt;
    ' Close the project&lt;BR /&gt;
    '-----&lt;BR /&gt;
    prjObject.Close&lt;BR /&gt;
    If Checkerror("Project.Close") = True Then&lt;BR /&gt;
        Exit Sub&lt;BR /&gt;
    End If&lt;BR /&gt;
       &lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Function Checkerror(fnName)&lt;BR /&gt;
    Checkerror = False&lt;BR /&gt;
    &lt;BR /&gt;
    Dim strmsg&lt;BR /&gt;
    Dim errNum&lt;BR /&gt;
    &lt;BR /&gt;
    If Err.Number &amp;lt;&amp;gt; 0 Then&lt;BR /&gt;
        strmsg = "Error #" &amp;amp; Hex(Err.Number) &amp;amp; vbCrLf &amp;amp; "In Function " &amp;amp; fnName &amp;amp; vbCrLf &amp;amp; Err.Description&lt;BR /&gt;
        'MsgBox strmsg  'Uncomment this line if you want to be notified via MessageBox of Errors in the script.&lt;BR /&gt;
        Checkerror = True&lt;BR /&gt;
    End If&lt;BR /&gt;
         &lt;BR /&gt;
End Function&lt;/I&gt;&lt;BR /&gt;
&lt;BR /&gt;
When i' m trying to run this script, nothing happens! &lt;BR /&gt;
&lt;BR /&gt;
I tried to delete error check from my script, ones again run it and recieved th message from Windows Script Host: Unable to connect to server: SASMain.&lt;BR /&gt;
So to run project i'm forced to push the button "run branch from .... task", then enter login and password to connect to server! Is it possible to correct my script so, that connection to server and running of my tasks occurs automatic?&lt;BR /&gt;
&lt;BR /&gt;
Thank you!</description>
      <pubDate>Fri, 31 Aug 2007 08:26:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/running-EG-projecvt-using-VBscript/m-p/4447#M1408</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-08-31T08:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: running EG projecvt using VBscript</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/running-EG-projecvt-using-VBscript/m-p/4448#M1409</link>
      <description>Hi Tano, &lt;BR /&gt;
&lt;BR /&gt;
Have you seen this SAS-Note?: &lt;A href="http://support.sas.com/techsup/unotes/SN/014/014700.html" target="_blank"&gt;http://support.sas.com/techsup/unotes/SN/014/014700.html&lt;/A&gt;&lt;BR /&gt;
In the bottom you'll find a link to the OLE Automation Guide, which is the engine for EG Scheduling.&lt;BR /&gt;
&lt;BR /&gt;
Anyhow, I do not know anything about Visual Basic programming, so I'll just assume that you wrote everything right; what I do know is that to schedule an EG project you should create (if EG doesn't do it for you), an Scheduled Task in Windows Control Panel.&lt;BR /&gt;
&lt;BR /&gt;
Identify the task that corresponds to your Project and set the USERID &amp;amp; PASSWORD you'll use in there. If you're working on a remote SAS server, make sure that your UserId starts with the Windows Domain. i.e. domain\userid.&lt;BR /&gt;
&lt;BR /&gt;
PS: If you double-click on the task and it doesn't run immediatly, it means that there's something wrong with the code.&lt;BR /&gt;
&lt;BR /&gt;
Cheers</description>
      <pubDate>Fri, 31 Aug 2007 13:24:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/running-EG-projecvt-using-VBscript/m-p/4448#M1409</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-08-31T13:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: running EG projecvt using VBscript</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/running-EG-projecvt-using-VBscript/m-p/594101#M34814</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am having the same issue where you able to resolve it?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Stephanie&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2019 13:51:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/running-EG-projecvt-using-VBscript/m-p/594101#M34814</guid>
      <dc:creator>SteUpenn</dc:creator>
      <dc:date>2019-10-04T13:51:19Z</dc:date>
    </item>
  </channel>
</rss>

