<?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: converting xls files to xlsx files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/348154#M273370</link>
    <description>&lt;P&gt;If you're using the ODS EXCEL statement on 9.4 then the files should (I think) actually be XLSX files, but you gave them an xls extension. See:&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/odsug/69832/HTML/default/viewer.htm#p09n5pw9ol0897n1qe04zeur27rv.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/odsug/69832/HTML/default/viewer.htm#p09n5pw9ol0897n1qe04zeur27rv.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Apr 2017 15:20:17 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2017-04-07T15:20:17Z</dc:date>
    <item>
      <title>converting xls files to xlsx files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/348146#M273367</link>
      <description>&lt;P&gt;I&amp;nbsp;have around 300 xls reports getting created through ODS, how can i convert them to xlsx files&amp;nbsp; !&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 15:09:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/348146#M273367</guid>
      <dc:creator>Deepti44</dc:creator>
      <dc:date>2017-04-07T15:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: converting xls files to xlsx files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/348152#M273368</link>
      <description>While you are creating the xls files through ODS using the file extension of xls,  you coud also create the excel files with extension xlsx&lt;BR /&gt;&lt;BR /&gt;could you please let us know the program you are using to create the xls files</description>
      <pubDate>Fri, 07 Apr 2017 15:17:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/348152#M273368</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2017-04-07T15:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: converting xls files to xlsx files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/348153#M273369</link>
      <description>&lt;P&gt;Excel VB programming is your best bet.&lt;/P&gt;
&lt;P&gt;Or go back to the SAS process that created them and change things to create XLSX instead of XLS.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 15:17:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/348153#M273369</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-04-07T15:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: converting xls files to xlsx files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/348154#M273370</link>
      <description>&lt;P&gt;If you're using the ODS EXCEL statement on 9.4 then the files should (I think) actually be XLSX files, but you gave them an xls extension. See:&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/odsug/69832/HTML/default/viewer.htm#p09n5pw9ol0897n1qe04zeur27rv.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/odsug/69832/HTML/default/viewer.htm#p09n5pw9ol0897n1qe04zeur27rv.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 15:20:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/348154#M273370</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-04-07T15:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: converting xls files to xlsx files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/348156#M273371</link>
      <description>&lt;P&gt;These are legacy reports created long back , just dont want to touch the code which the report created in xls&amp;nbsp; as there are 300 scripts to go through , i just want to take already created xls file and convert them to xlsx file as is ...&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 15:23:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/348156#M273371</guid>
      <dc:creator>Deepti44</dc:creator>
      <dc:date>2017-04-07T15:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: converting xls files to xlsx files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/348158#M273372</link>
      <description>&lt;P&gt;there are 300 scripts to go through and ithese are old legacy scripts created in sas ods.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 15:25:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/348158#M273372</guid>
      <dc:creator>Deepti44</dc:creator>
      <dc:date>2017-04-07T15:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: converting xls files to xlsx files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/348159#M273373</link>
      <description>&lt;P&gt;these reports are legacy and have been created long back in sas !&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 15:25:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/348159#M273373</guid>
      <dc:creator>Deepti44</dc:creator>
      <dc:date>2017-04-07T15:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: converting xls files to xlsx files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/348162#M273374</link>
      <description>I hope this link will help you &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://support.sas.com/kb/43/496.html" target="_blank"&gt;http://support.sas.com/kb/43/496.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;please try the macro in the link</description>
      <pubDate>Fri, 07 Apr 2017 15:29:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/348162#M273374</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2017-04-07T15:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: converting xls files to xlsx files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/348253#M273375</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/134796"&gt;@Deepti44&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;these reports are legacy and have been created long back in sas !&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT color="#ff0000"&gt;Use EXCEL VB script to modify existing files.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;In 3 hours I know that I could have manually opened and done a file save as to xlsx for at least 150 files. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;This is really an Excel problem since you say you do not want to change SAS code and recreate the files from scratch.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 18:15:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/348253#M273375</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-04-07T18:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: converting xls files to xlsx files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/348414#M273376</link>
      <description>&lt;P&gt;That is definitely what is needed. As long as SAS is running on a Windows machine then it should work.&lt;/P&gt;
&lt;P&gt;The program posted by SAS on that link seems to have some bugs.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a cleaned up version with the unneede extra complexity of wrapping it in a macro removed.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let dir=c:\downloads ;
%let ext=xls ;

* Generate Visual Basic program ;
data _null_;
file "'&amp;amp;dir\temp.vbs'";
put "set xlapp = CreateObject(""Excel.Application"")";
put "set fso = CreateObject(""scripting.filesystemobject"")";
put "set myfolder = fso.GetFolder(""&amp;amp;dir"")";
put "set myfiles = myfolder.Files";
put "xlapp.DisplayAlerts = False";
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;dir.\"" &amp;amp; Filename &amp;amp; "".xlsx"", 51";
put "    mybook.Close";
put "  End If";
put "Next";
put "xlapp.DisplayAlerts = True";
put "xlapp.Quit";
put "Set xlapp = Nothing";
put "strScript = Wscript.ScriptFullName";
put "FSO.DeleteFile(strScript)"; 
run; 
 
* Show the generated program ;
data _null_;
  infile "'&amp;amp;dir\temp.vbs'";
  input;
  put _n_ 4. +1 _infile_;
run;

* Run the generated program ;
data _null_;
  infile "cscript ""&amp;amp;dir\temp.vbs""" pipe;
  input;
  put _infile_;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 08 Apr 2017 14:22:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/348414#M273376</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-04-08T14:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: converting xls files to xlsx files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/388760#M273377</link>
      <description>&lt;P&gt;Thanks a lot for this code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I am using EG 5.1 and the following part of the script is not working:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; _null_&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="token statement"&gt;infile&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"cscript ""&amp;amp;dir\temp.vbs"""&lt;/SPAN&gt; pipe&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="token keyword"&gt;put&lt;/SPAN&gt; _infile_&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="token punctuation"&gt;Moreover from time to time, I am getting the following error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="token punctuation"&gt;Unable to get the Open property of the Workbooks class &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="token punctuation"&gt;Also, is it possible to avoid to read or to import in the file list, the file temp.vbs&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="token punctuation"&gt;The script try to open that file and it stop.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="token punctuation"&gt;Does anyone could help me with those issues?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="token punctuation"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="token punctuation"&gt;Alain&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 12:46:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-xls-files-to-xlsx-files/m-p/388760#M273377</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2017-08-17T12:46:56Z</dc:date>
    </item>
  </channel>
</rss>

