Opening an Excel workbook using LIBNAME

Accepted Solution Solved
Reply
Contributor
Posts: 20
Accepted Solution

Opening an Excel workbook using LIBNAME

[ Edited ]

Hi,

 

LIBNAME MyLibRef EXCEL "C:\MYPATH\MYEXCEL.XLS" ;

 

gives me errors.  Any ideas on what's wrong?

 

I'm using SAS 9.3 and Excel 2013. 


Accepted Solutions
Solution
‎06-14-2017 04:24 PM
Grand Advisor
Posts: 10,211

Re: Opening an Excel workbook using LIBNAME

Post the text of the error.

There can be many issues: incorrect path, incorrect filename, file type doesn't match expectation of the engine (xls and xlsx are NOT the same file format), whether you have access to PC Files licensed, system permissions, and that's just a start.

View solution in original post


All Replies
Solution
‎06-14-2017 04:24 PM
Grand Advisor
Posts: 10,211

Re: Opening an Excel workbook using LIBNAME

Post the text of the error.

There can be many issues: incorrect path, incorrect filename, file type doesn't match expectation of the engine (xls and xlsx are NOT the same file format), whether you have access to PC Files licensed, system permissions, and that's just a start.

Contributor
Posts: 20

Re: Opening an Excel workbook using LIBNAME

Hi,

 

I should have specified PCFILES as the engine, not EXCEL:

 

This works:

LIBNAME MyLibRef PCFILES "C:\MYPATH\MYEXCEL.XLS" ;

 

Thank you, I appreciate your help.

Contributor
Posts: 34

Re: Opening an Excel workbook using LIBNAME

[ Edited ]

This always works

 

libname HELLO pcfiles path = "C:\TEMP\myfile.xlsx" textsize = 32767 ;

DATA MYFILE;

set HELLO.'MYSHEET$'n;

run; libname HELLO clear;

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 91 views
  • 0 likes
  • 3 in conversation