title: SAS PROC IMPORT with Dynamic Named Ranges
body: <p>I have a workbook containing database information split into various tabs that I want to import into SAS for further manipulation.</p>
  
  <p>The dimensions of these database tables vary from tab to tab and in addition, there might be further changes to the dimensions of the table throughout the tenure of this project.</p>
  
  <p>As such, I've set up dynamic named ranges in every tab such that it picks up the exact dimensions I require i.e. My named range <code>TBL_SHEET1</code></p>
  
  <pre><code>=OFFSET(SHEET1!$A$1,0,0,COUNTA(SHEET1!$A:$A),COUNTA(SHEET1!$1:$1)-2)
  </code></pre>
  
  <p>Now the SAS issue is that when I use the proc import code, it does not seem to think these named ranges "exist" and returns a failure message in the log.</p>
  
  <p>Is there a way around this? Or just a limitation in the way SAS communicates with Excel?</p>
  
  <p>(As a side note, the reason why I am not just importing the entire tab is because there are some extra columns to the right which I want to exclude from my import)</p>
  
  <p>My SAS import code:</p>
  
  <pre><code>proc import 
  out= rwork.SHEET1
  datafile = "C:\My User\Sample.xlsx"
  dbms= excel replace;
  range=TBL_SHEET1.;
  getnames=yes;
  run;
  </code></pre>