<?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: Import a password protected Excel doc in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Import-a-password-protected-Excel-doc/m-p/33887#M8210</link>
    <description>Shows what I know.  I did not even know that an Excel file could be password protected.&lt;BR /&gt;
&lt;BR /&gt;
Have you tried passing the password through the PIPE engine on the FILENAME statement?  That is just a guess.</description>
    <pubDate>Tue, 16 Nov 2010 01:59:23 GMT</pubDate>
    <dc:creator>ArtC</dc:creator>
    <dc:date>2010-11-16T01:59:23Z</dc:date>
    <item>
      <title>Import a password protected Excel doc</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Import-a-password-protected-Excel-doc/m-p/33886#M8209</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
How do I import a password protected Excel document?  My proc imports works fine any non-password protected excel doc.  I tried adding 'password = ' to the code below, but got an error with the password= option.  Any input will be greatly appreciated.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
&lt;BR /&gt;
proc import out= ssn1&lt;BR /&gt;
            datafile= "&amp;amp;Ssn_FILE"&lt;BR /&gt;
            dbms=EXCEL replace;   &lt;BR /&gt;
            mixed = yes;    &lt;BR /&gt;
            sheet= "Sheet1";                   	&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 15 Nov 2010 16:58:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Import-a-password-protected-Excel-doc/m-p/33886#M8209</guid>
      <dc:creator>KevinC_</dc:creator>
      <dc:date>2010-11-15T16:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Import a password protected Excel doc</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Import-a-password-protected-Excel-doc/m-p/33887#M8210</link>
      <description>Shows what I know.  I did not even know that an Excel file could be password protected.&lt;BR /&gt;
&lt;BR /&gt;
Have you tried passing the password through the PIPE engine on the FILENAME statement?  That is just a guess.</description>
      <pubDate>Tue, 16 Nov 2010 01:59:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Import-a-password-protected-Excel-doc/m-p/33887#M8210</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2010-11-16T01:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: Import a password protected Excel doc</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Import-a-password-protected-Excel-doc/m-p/33888#M8211</link>
      <description>Hi .&lt;BR /&gt;
Maybe you need build a ODBC connection for that xls file,because SAS treat Excel file as a library,but it is too troubled.Or recommend you to use password to open that Excel file and File-&amp;gt; Save as-&amp;gt;xls file to make a xls file without password.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Thu, 18 Nov 2010 07:05:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Import-a-password-protected-Excel-doc/m-p/33888#M8211</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-11-18T07:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Import a password protected Excel doc</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Import-a-password-protected-Excel-doc/m-p/33889#M8212</link>
      <description>Greetings.&lt;BR /&gt;
&lt;BR /&gt;
The old time solution is DDE.&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="&amp;lt;br"&gt;
&lt;/A&gt;&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=35783诇" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=35783诇&lt;/A&gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=35783诇" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=35783诇&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Oleg.</description>
      <pubDate>Thu, 18 Nov 2010 08:17:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Import-a-password-protected-Excel-doc/m-p/33889#M8212</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2010-11-18T08:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Import a password protected Excel doc</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Import-a-password-protected-Excel-doc/m-p/33890#M8213</link>
      <description>I'm not an expert in VBA but you can use MS Excel programming language (VBA)  and PIPE engine to disable the password protection.&lt;BR /&gt;
&lt;B&gt;The code below sets the password.&lt;/B&gt; I'm not the author of this code. I've find it somewhere and It was very helpful as a solution of some tasks in different modifications. For example, I've modified it to rename Excel sheets.&lt;BR /&gt;
You can change the VBA code to disable password protection.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
filename IN  '.\book1.xls';&lt;BR /&gt;
filename OUT '.\book1PW.xls';&lt;BR /&gt;
%let PW = PWvalue;&lt;BR /&gt;
data _null_;&lt;BR /&gt;
 length script filevar command workbook1 workbook2 $256 pw $16;&lt;BR /&gt;
 script    = catx('\',pathname('WORK'),'PASSWORD.vbs');&lt;BR /&gt;
 filevar   = script;   workbook1 = pathname('in');&lt;BR /&gt;
 workbook2 = pathname('out');&lt;BR /&gt;
 pw        = symget('PW');&lt;BR /&gt;
 file dummy1 filevar=filevar;&lt;BR /&gt;
 put 'Const ' workbook1=$quote256.;&lt;BR /&gt;
 put 'Const ' workbook2=$quote256.;&lt;BR /&gt;
 put 'Const ' pw=$quote18.;&lt;BR /&gt;
 put 'Set objExcel = CreateObject("Excel.Application")';&lt;BR /&gt;
 put 'objExcel.Visible = FALSE';&lt;BR /&gt;
 put 'objExcel.DisplayAlerts = FALSE';&lt;BR /&gt;
 put 'Set objWorkbook  = objExcel.Workbooks.Open(workbook1)';&lt;BR /&gt;
 put 'objWorkbook.SaveAs workbook2,,pw';&lt;BR /&gt;
 put 'objExcel.Quit';&lt;BR /&gt;
  /* close the script file by opening another file */&lt;BR /&gt;
 filevar = catx('\',pathname('WORK'),'DUMMY2.vbs');&lt;BR /&gt;
 file dummy1 filevar=filevar;&lt;BR /&gt;
  /* look at the script, not necessary but may be useful */&lt;BR /&gt;
 infile dummy3 filevar=script end=eof;&lt;BR /&gt;
 do _n_ = 1 by 1 until(eof);      input;&lt;BR /&gt;
 putlog 'NOTE: ' _n_ 3. +1 _infile_;      end;&lt;BR /&gt;
 /* call the script */&lt;BR /&gt;
 command = catx(' ','cscript',quote(strip(script)));&lt;BR /&gt;
 infile dummy4 pipe filevar=command end=eof;&lt;BR /&gt;
 do until(eof);&lt;BR /&gt;
 input ;&lt;BR /&gt;
 putlog _infile_;&lt;BR /&gt;
 end;&lt;BR /&gt;
 stop;&lt;BR /&gt;
 run;&lt;BR /&gt;
&lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 18 Nov 2010 08:58:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Import-a-password-protected-Excel-doc/m-p/33890#M8213</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2010-11-18T08:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Import a password protected Excel doc</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Import-a-password-protected-Excel-doc/m-p/33891#M8214</link>
      <description>Thank you all very much for your help!  I copied the content of the excel to another excel without password proection then read from the unprotected file.  I will try your methods/code above.  &lt;BR /&gt;
&lt;BR /&gt;
Thank you agian!</description>
      <pubDate>Fri, 19 Nov 2010 22:16:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Import-a-password-protected-Excel-doc/m-p/33891#M8214</guid>
      <dc:creator>KevinC_</dc:creator>
      <dc:date>2010-11-19T22:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Import a password protected Excel doc</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Import-a-password-protected-Excel-doc/m-p/808460#M81764</link>
      <description>&lt;P&gt;Hi Oleg.&amp;nbsp; I realize that this post is from a previous decade but here goes anyway. I am ultimately trying to read a lot of locked Excel data into a dataset.&amp;nbsp; I am using EG 8.4 and have copied the files to the server.&amp;nbsp; I tried DDE since the files are copied to the server using another one of your examples but the line&amp;nbsp; filename cc dde 'Excel|System'; throws this error: ERROR: Invalid device type.ERROR: Error in the FILENAME statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I was trying the VBA script option you mention, modified to read the file with password, unprotect it, and re-save without password.&amp;nbsp; &amp;nbsp;But I'm getting the error that&amp;nbsp; it doesn't understand the C-shell command:&amp;nbsp;&amp;nbsp;/bin/bash: cscript: command not found&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions? If not, I am going to just work outside of SAS. It will just be slow...&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 00:08:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Import-a-password-protected-Excel-doc/m-p/808460#M81764</guid>
      <dc:creator>Bryte</dc:creator>
      <dc:date>2022-04-19T00:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Import a password protected Excel doc</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Import-a-password-protected-Excel-doc/m-p/808461#M81765</link>
      <description>&lt;P&gt;DDE is only possible if you are running SAS on your PC and the Excel file is accessible from the PC. Sounds like your EG uses a remote Unix SAS server so it isn't going to work and VBA wont run on Unix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The quick fix is to create an un-passworded version and upload that to your SAS server.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 00:29:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Import-a-password-protected-Excel-doc/m-p/808461#M81765</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-04-19T00:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Import a password protected Excel doc</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Import-a-password-protected-Excel-doc/m-p/808839#M81772</link>
      <description>&lt;P&gt;I appreciate this post is 12 years old, but my team finally added this feature to Data Controller today!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just upload the excel, enter the password, approve the change, and your password-protected excel data is now in your target SAS table ready to process.&lt;BR /&gt;&lt;BR /&gt;Works on ALL versions of SAS (Viya, EBI, Base) and is free for up to 5 users.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://www.youtube.com/watch?v=b2lfBCkdvBI" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.youtube.com/watch?v=b2lfBCkdvBI&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 14:21:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Import-a-password-protected-Excel-doc/m-p/808839#M81772</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2022-04-20T14:21:18Z</dc:date>
    </item>
  </channel>
</rss>

