<?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: Convert ODS TAGSETS.EXCELXP .xls output  to .xlsx file in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Convert-ODS-TAGSETS-EXCELXP-xls-output-to-xlsx-file/m-p/480524#M21324</link>
    <description>&lt;P&gt;Add an IF condition to check if the FILENAME is the value you want.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Probably at this point, expand the condition to be if extname=... and fileName = .... then...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put "    if ExtName=""&amp;amp;ext"" then";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/99082"&gt;@eferencik&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I attempted using the code shown here,&amp;nbsp;&lt;A href="http://support.sas.com/kb/43/496.html" target="_self"&gt;http://support.sas.com/kb/43/496.html&lt;/A&gt;, but need something that will convert only the report that the program outputs.&amp;nbsp; I do not want every .xls file in the folder converted this code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How would I modify the macro program to only convert the report name specified?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options noxwait noxsync; 
 
%macro convert_files(default=,ext=);
 
data _null_;
file "'&amp;amp;default\temp.vbs'";
put "set xlapp = CreateObject(""Excel.Application"")";
put "set fso = CreateObject(""scripting.filesystemobject"")";
put "set myfolder = fso.GetFolder(""&amp;amp;default"")";
put "set myfiles = myfolder.Files";
put "xlapp.DisplayAlerts = False";
put " ";
put "for each f in myfiles";
put "  ExtName = fso.GetExtensionName(f)";
put "  Filename= fso.GetBaseName(f)";
put "    if ExtName=""&amp;amp;ext"" then";
put "           set mybook = xlapp.Workbooks.Open(f.Path)"; 
put "           xlapp.Visible = false";
put "           mybook.SaveAs ""&amp;amp;default.\"" &amp;amp; Filename &amp;amp; "".xlsx"", 51";
put "    End If";
put "  Next";
put "  mybook.Close";
put "  xlapp.DisplayAlerts = True";
/* Removes original files */
/*put " FSO.DeleteFile(""&amp;amp;default\*.&amp;amp;ext""), DeleteReadOnly";*/
put " xlapp.Quit";
put " Set xlapp = Nothing";
put " strScript = Wscript.ScriptFullName";
put " FSO.DeleteFile(strScript)"; 
run; 
 
x "cscript ""&amp;amp;default\temp.vbs""";
 
%mend;
 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to be able to specify the file that needs to be converted.&amp;nbsp; Something like the code below where the report name is "&lt;STRONG&gt;CO Turnover Rate &amp;amp;title&lt;/STRONG&gt;".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options noxsync noxwait;

%include "c:\convert.sas";

%convert_files(default=c:\users\desktop\Test\CO Turnover Rate &amp;amp;title,ext=xls);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Jul 2018 16:24:33 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-07-23T16:24:33Z</dc:date>
    <item>
      <title>Convert ODS TAGSETS.EXCELXP .xls output  to .xlsx file</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Convert-ODS-TAGSETS-EXCELXP-xls-output-to-xlsx-file/m-p/480520#M21323</link>
      <description>&lt;P&gt;I attempted using the code shown here,&amp;nbsp;&lt;A href="http://support.sas.com/kb/43/496.html" target="_self"&gt;http://support.sas.com/kb/43/496.html&lt;/A&gt;, but need something that will convert only the report that the program outputs.&amp;nbsp; I do not want every .xls file in the folder converted this code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I modify the macro program to only convert the report name specified?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options noxwait noxsync; 
 
%macro convert_files(default=,ext=);
 
data _null_;
file "'&amp;amp;default\temp.vbs'";
put "set xlapp = CreateObject(""Excel.Application"")";
put "set fso = CreateObject(""scripting.filesystemobject"")";
put "set myfolder = fso.GetFolder(""&amp;amp;default"")";
put "set myfiles = myfolder.Files";
put "xlapp.DisplayAlerts = False";
put " ";
put "for each f in myfiles";
put "  ExtName = fso.GetExtensionName(f)";
put "  Filename= fso.GetBaseName(f)";
put "    if ExtName=""&amp;amp;ext"" then";
put "           set mybook = xlapp.Workbooks.Open(f.Path)"; 
put "           xlapp.Visible = false";
put "           mybook.SaveAs ""&amp;amp;default.\"" &amp;amp; Filename &amp;amp; "".xlsx"", 51";
put "    End If";
put "  Next";
put "  mybook.Close";
put "  xlapp.DisplayAlerts = True";
/* Removes original files */
/*put " FSO.DeleteFile(""&amp;amp;default\*.&amp;amp;ext""), DeleteReadOnly";*/
put " xlapp.Quit";
put " Set xlapp = Nothing";
put " strScript = Wscript.ScriptFullName";
put " FSO.DeleteFile(strScript)"; 
run; 
 
x "cscript ""&amp;amp;default\temp.vbs""";
 
%mend;
 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to be able to specify the file that needs to be converted.&amp;nbsp; Something like the code below where the report name is "&lt;STRONG&gt;CO Turnover Rate &amp;amp;title&lt;/STRONG&gt;".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options noxsync noxwait;

%include "c:\convert.sas";

%convert_files(default=c:\users\desktop\Test\CO Turnover Rate &amp;amp;title,ext=xls);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 16:20:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Convert-ODS-TAGSETS-EXCELXP-xls-output-to-xlsx-file/m-p/480520#M21323</guid>
      <dc:creator>eferencik</dc:creator>
      <dc:date>2018-07-23T16:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: Convert ODS TAGSETS.EXCELXP .xls output  to .xlsx file</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Convert-ODS-TAGSETS-EXCELXP-xls-output-to-xlsx-file/m-p/480524#M21324</link>
      <description>&lt;P&gt;Add an IF condition to check if the FILENAME is the value you want.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Probably at this point, expand the condition to be if extname=... and fileName = .... then...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put "    if ExtName=""&amp;amp;ext"" then";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/99082"&gt;@eferencik&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I attempted using the code shown here,&amp;nbsp;&lt;A href="http://support.sas.com/kb/43/496.html" target="_self"&gt;http://support.sas.com/kb/43/496.html&lt;/A&gt;, but need something that will convert only the report that the program outputs.&amp;nbsp; I do not want every .xls file in the folder converted this code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How would I modify the macro program to only convert the report name specified?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options noxwait noxsync; 
 
%macro convert_files(default=,ext=);
 
data _null_;
file "'&amp;amp;default\temp.vbs'";
put "set xlapp = CreateObject(""Excel.Application"")";
put "set fso = CreateObject(""scripting.filesystemobject"")";
put "set myfolder = fso.GetFolder(""&amp;amp;default"")";
put "set myfiles = myfolder.Files";
put "xlapp.DisplayAlerts = False";
put " ";
put "for each f in myfiles";
put "  ExtName = fso.GetExtensionName(f)";
put "  Filename= fso.GetBaseName(f)";
put "    if ExtName=""&amp;amp;ext"" then";
put "           set mybook = xlapp.Workbooks.Open(f.Path)"; 
put "           xlapp.Visible = false";
put "           mybook.SaveAs ""&amp;amp;default.\"" &amp;amp; Filename &amp;amp; "".xlsx"", 51";
put "    End If";
put "  Next";
put "  mybook.Close";
put "  xlapp.DisplayAlerts = True";
/* Removes original files */
/*put " FSO.DeleteFile(""&amp;amp;default\*.&amp;amp;ext""), DeleteReadOnly";*/
put " xlapp.Quit";
put " Set xlapp = Nothing";
put " strScript = Wscript.ScriptFullName";
put " FSO.DeleteFile(strScript)"; 
run; 
 
x "cscript ""&amp;amp;default\temp.vbs""";
 
%mend;
 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to be able to specify the file that needs to be converted.&amp;nbsp; Something like the code below where the report name is "&lt;STRONG&gt;CO Turnover Rate &amp;amp;title&lt;/STRONG&gt;".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options noxsync noxwait;

%include "c:\convert.sas";

%convert_files(default=c:\users\desktop\Test\CO Turnover Rate &amp;amp;title,ext=xls);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 16:24:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Convert-ODS-TAGSETS-EXCELXP-xls-output-to-xlsx-file/m-p/480524#M21324</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-23T16:24:33Z</dc:date>
    </item>
  </channel>
</rss>

