<?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 How can VBA detect if the STP resulted in an error? in Microsoft Integration with SAS</title>
    <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/How-can-VBA-detect-if-the-STP-resulted-in-an-error/m-p/641806#M2473</link>
    <description>&lt;P&gt;Is there a way to catch SP errors in VBA?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This portion of the VBA code brings in the Stored Process. I thought adding "On Error GoTo ErrMsg" prior to inserting the STP would work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Dim stp_run_all As SASStoredProcess 'Bring in "Run all" STP

'On Error GoTo ErrMsg
Set stp_run_all = sas.InsertStoredProcess("/Drive/TOOL/SP_Dly_DandL_Run_all_AMO", Runner.Sheets("Run").Range("L6"), , outputParams, inputStreams)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I need to be able to catch when the STP errors, and then perform some things when it does (message box saying there was an error, delete some sheets, delete the STP from the file).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help appreciated!&lt;/P&gt;</description>
    <pubDate>Wed, 22 Apr 2020 03:26:21 GMT</pubDate>
    <dc:creator>sustagens</dc:creator>
    <dc:date>2020-04-22T03:26:21Z</dc:date>
    <item>
      <title>How can VBA detect if the STP resulted in an error?</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/How-can-VBA-detect-if-the-STP-resulted-in-an-error/m-p/641806#M2473</link>
      <description>&lt;P&gt;Is there a way to catch SP errors in VBA?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This portion of the VBA code brings in the Stored Process. I thought adding "On Error GoTo ErrMsg" prior to inserting the STP would work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Dim stp_run_all As SASStoredProcess 'Bring in "Run all" STP

'On Error GoTo ErrMsg
Set stp_run_all = sas.InsertStoredProcess("/Drive/TOOL/SP_Dly_DandL_Run_all_AMO", Runner.Sheets("Run").Range("L6"), , outputParams, inputStreams)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I need to be able to catch when the STP errors, and then perform some things when it does (message box saying there was an error, delete some sheets, delete the STP from the file).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 03:26:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/How-can-VBA-detect-if-the-STP-resulted-in-an-error/m-p/641806#M2473</guid>
      <dc:creator>sustagens</dc:creator>
      <dc:date>2020-04-22T03:26:21Z</dc:date>
    </item>
  </channel>
</rss>

