<?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: use if tab exist then delete in VBA SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/use-if-tab-exist-then-delete-in-VBA-SAS/m-p/583914#M166259</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;A VBA script has nothing to do with SAS&lt;/P&gt;&lt;P&gt;You'l probably have more luck asking a purely VBA question on a Microsoft forum.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;With SAS' move away from DDE, posts asking for help with DDE lead to replies saying, "Don't use DDE, that's old technology, it's unsupported, and risky" and saying "use the SAS VBA add-in instead if you are trying to do things you used to do with DDE."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think this forum is a fine place for people to ask for VBA help now that SAS has pushed VBA as the alternative to DDE. Would you tell posters in the past who asked about DDE, before it was put to pasture,&amp;nbsp;to go to a Microsoft forum? I would hope not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My recommendation would be to do a google search first as his question isn't SAS-specific but I wouldn't direct him away from posting on this forum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's some code that may get him pointed in the right direction:&lt;/P&gt;&lt;P&gt;(lifted gratuitously from stackoverflow:&amp;nbsp; &lt;A href="https://stackoverflow.com/questions/6688131/test-or-check-if-sheet-exists" target="_blank"&gt;https://stackoverflow.com/questions/6688131/test-or-check-if-sheet-exists&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="kwd"&gt;Function&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; CheckIfSheetExists&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;SheetName &lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;As&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;String&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;As&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;Boolean&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln"&gt;CheckIfSheetExists &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt; &lt;SPAN class="lit"&gt;False&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="kwd"&gt;For&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;Each&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; WS &lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;In&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; Worksheets&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="kwd"&gt;If&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; SheetName &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; WS&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;name &lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;Then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln"&gt;CheckIfSheetExists &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt; &lt;SPAN class="lit"&gt;True&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="kwd"&gt;Exit&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;Function&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="kwd"&gt;End&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;If&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="kwd"&gt;Next&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; WS &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="kwd"&gt;End&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;Function&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Aug 2019 14:06:44 GMT</pubDate>
    <dc:creator>DWilson</dc:creator>
    <dc:date>2019-08-26T14:06:44Z</dc:date>
    <item>
      <title>use if tab exist then delete in VBA SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-if-tab-exist-then-delete-in-VBA-SAS/m-p/583044#M165935</link>
      <description>&lt;P&gt;Put "objexcel.sheets(""Sheet1"").Delete";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I WANT TO USE IF TAB EXIST THEN DELETE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please can some one help me?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 03:25:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-if-tab-exist-then-delete-in-VBA-SAS/m-p/583044#M165935</guid>
      <dc:creator>sam1231</dc:creator>
      <dc:date>2019-08-22T03:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: use if tab exist then delete in VBA SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-if-tab-exist-then-delete-in-VBA-SAS/m-p/583798#M166226</link>
      <description>&lt;P&gt;A VBA script has nothing to do with SAS&lt;/P&gt;
&lt;P&gt;You'l probably have more luck asking a purely VBA question on a Microsoft forum.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Aug 2019 23:10:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-if-tab-exist-then-delete-in-VBA-SAS/m-p/583798#M166226</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-08-25T23:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: use if tab exist then delete in VBA SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-if-tab-exist-then-delete-in-VBA-SAS/m-p/583914#M166259</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;A VBA script has nothing to do with SAS&lt;/P&gt;&lt;P&gt;You'l probably have more luck asking a purely VBA question on a Microsoft forum.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;With SAS' move away from DDE, posts asking for help with DDE lead to replies saying, "Don't use DDE, that's old technology, it's unsupported, and risky" and saying "use the SAS VBA add-in instead if you are trying to do things you used to do with DDE."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think this forum is a fine place for people to ask for VBA help now that SAS has pushed VBA as the alternative to DDE. Would you tell posters in the past who asked about DDE, before it was put to pasture,&amp;nbsp;to go to a Microsoft forum? I would hope not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My recommendation would be to do a google search first as his question isn't SAS-specific but I wouldn't direct him away from posting on this forum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's some code that may get him pointed in the right direction:&lt;/P&gt;&lt;P&gt;(lifted gratuitously from stackoverflow:&amp;nbsp; &lt;A href="https://stackoverflow.com/questions/6688131/test-or-check-if-sheet-exists" target="_blank"&gt;https://stackoverflow.com/questions/6688131/test-or-check-if-sheet-exists&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="kwd"&gt;Function&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; CheckIfSheetExists&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;SheetName &lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;As&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;String&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;As&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;Boolean&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln"&gt;CheckIfSheetExists &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt; &lt;SPAN class="lit"&gt;False&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="kwd"&gt;For&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;Each&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; WS &lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;In&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; Worksheets&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="kwd"&gt;If&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; SheetName &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; WS&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;name &lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;Then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln"&gt;CheckIfSheetExists &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt; &lt;SPAN class="lit"&gt;True&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="kwd"&gt;Exit&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;Function&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="kwd"&gt;End&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;If&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="kwd"&gt;Next&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; WS &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="kwd"&gt;End&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;Function&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 14:06:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-if-tab-exist-then-delete-in-VBA-SAS/m-p/583914#M166259</guid>
      <dc:creator>DWilson</dc:creator>
      <dc:date>2019-08-26T14:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: use if tab exist then delete in VBA SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-if-tab-exist-then-delete-in-VBA-SAS/m-p/584092#M166299</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/83374"&gt;@DWilson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt; I think this forum is a fine place for people to ask for VBA help now that SAS has pushed VBA as the alternative to DDE. Would you tell posters in the past who asked about DDE, before it was put to pasture,&amp;nbsp;to go to a Microsoft forum? I would hope not.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We'll have to agree to disagree.&lt;/P&gt;
&lt;P&gt;I responded after no reply was given for 4 days. VBA skills are plentiful on MS forums (of course) and rare here.&lt;/P&gt;
&lt;P&gt;There is no doubt that an answer would have been swiftly given on these forums.&lt;/P&gt;
&lt;P&gt;Same thing for DDE questions involving MS scripts. Or for VBS questions.&lt;/P&gt;
&lt;P&gt;So the best advice imho is the advice I gave.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 22:35:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-if-tab-exist-then-delete-in-VBA-SAS/m-p/584092#M166299</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-08-26T22:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: use if tab exist then delete in VBA SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-if-tab-exist-then-delete-in-VBA-SAS/m-p/584235#M166349</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/83374"&gt;@DWilson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;gt; I think this forum is a fine place for people to ask for VBA help now that SAS has pushed VBA as the alternative to DDE. Would you tell posters in the past who asked about DDE, before it was put to pasture,&amp;nbsp;to go to a Microsoft forum? I would hope not.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We'll have to agree to disagree.&lt;/P&gt;&lt;P&gt;I responded after no reply was given for 4 days. VBA skills are plentiful on MS forums (of course) and rare here.&lt;/P&gt;&lt;P&gt;There is no doubt that an answer would have been swiftly given on these forums.&lt;/P&gt;&lt;P&gt;Same thing for DDE questions involving MS scripts. Or for VBS questions.&lt;/P&gt;&lt;P&gt;So the best advice imho is the advice I gave.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Sure. I wholeheartedly agree that VBA skills are plentiful on MS forums and rarer here. But I think SAS put themselves into the position of expanding the set of SAS users who need VBA because they've pushed a change to their technologies that put the onus on VBA to fill the gap left by their removal of DDE support. It shouldn't be unexpected to see more VBA questions here.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I suspect this is more of a generational change (younger folks opting to use VBA) in SAS use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also suspect that the set of SAS users/business that need the level of fine-grained control over excel reports is a relatively small fraction over the set of SAS users who produce reports with Excel. This is also a reason why most posters seem to not care about the deprecation of DDE support with SAS&amp;nbsp; (not to mention the loss of DDE support with&amp;nbsp;base SAS&amp;nbsp;for the SAS grid environment being pushed by SAS.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;p.s. Fwiw, the removal of DDE support without providing a concomitant replacement functionality is the windmill to my Don Quixote. So, pre- and post- apologies if I come across as earnest. &amp;nbsp;If SAS simply added the ability to write to a single cell in an existing excel spreadsheet without touching the other cells in the spreadsheet (e.g. supporting the use of table templates in excel) then that would address my concern. Asking users to learn VBA and pull data into Excel from SAS to replicate this functionality is silly. A multi-billion dollar company should be able to do something better.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2019 14:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-if-tab-exist-then-delete-in-VBA-SAS/m-p/584235#M166349</guid>
      <dc:creator>DWilson</dc:creator>
      <dc:date>2019-08-27T14:10:31Z</dc:date>
    </item>
  </channel>
</rss>

