BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
xiliang
Calcite | Level 5

When I try to load a file "test.xls" (97-2003 Workbook) that is generated by Microsoft Excel 2010 SMO 64 bit, using Enterprise Guide 64 bit. The test.xls is a The error message is:

 

ERROR: Connect: Class not registered

ERROR: Error in the LIBNAME statement

 

I have tried the following statement and all have the same error

 

libname refname excel path="C:\workspace\test.xls'';

libname refname "C:\workspace\test.xls";

 

I also tried to cover 'test.xls' (Excel 97-2003 Workbook) to 'text.xlsx'(Excel Workbook), and the following statement also did not work:

 

libname refname excel path='C:\workspace\test.xlsx';

libname refname xlsx path='C:\workspace\test.xlsx';

libname refname 'C:\workspace\test.xlsx';

 

Appreciate any advice!

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

You have typos in that code:

 

libname tmp excel 'C:\workspace\test.xlsx';

Take the path= out of it.  

 

 

Or you can use proc import:

 

proc import datafile="c:/workspace/test.xlsx" out=want dbms=xlsx replace;
run;

Note that to load XLS files you will need pcfiles server as that is a very old file format and windows only.

 

View solution in original post

8 REPLIES 8
RW9
Diamond | Level 26 RW9
Diamond | Level 26

You have typos in that code:

 

libname tmp excel 'C:\workspace\test.xlsx';

Take the path= out of it.  

 

 

Or you can use proc import:

 

proc import datafile="c:/workspace/test.xlsx" out=want dbms=xlsx replace;
run;

Note that to load XLS files you will need pcfiles server as that is a very old file format and windows only.

 

xiliang
Calcite | Level 5

The first option below does not work and still has the same error:

libname tmp excel 'C:\workspace\test.xlsx';

The second option works beautifully:

 

 

 

proc import datafile="c:/workspace/test.xlsx" out=want dbms=xlsx replace; run;<code></code>

 

 

 

 

My understanding is that I do not need pcfile server, since I have using both 64 bit Excel and 64 bit SAS. The following is from the link of SAS Support

 

"If you are running a 64-bit version of Microsoft Office and SAS on 64-bit Microsoft Windows, you do not need to install SAS PC Files Server, except if you plan to connect from a Linux- or UNIX-based SAS installation."

Kurt_Bremser
Super User

Use the same engine that works in proc import for your libname:

libname tmp xlsx 'C:\workspace\test.xlsx';

 

PS this was meant to be an answer to a post from @xiliang that has been deleted in the meantime.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Quite true, there are far to many Excel based engines around.  Just use a nice open source file format and bin the horrible proprietary stuff for a better future for us all!

Kurt_Bremser
Super User

@RW9 wrote:

Quite true, there are far to many Excel based engines around.  Just use a nice open source file format and bin the horrible proprietary stuff for a better future for us all!


Absolutely. That stuff has proven itself to be a total hellhole for users. I know why I exclusively use LibreOffice for my spreadsheet needs. Has kept the same file format and user interface for more than a decade now. That's why I've been urging SAS every now and then to support OpenOffice/LibreOffice, at least the .ods format.

xiliang
Calcite | Level 5

Thanks! Indeed the error was caused by a typo!

Kurt_Bremser
Super User

Are you using the Local SAS server? If not, you won't have access to the C: drive of your desktop.

Do you have SAS/ACCESS to PC Files licensed? Run proc setinit and proc product_status to determine that.

 

 

xiliang
Calcite | Level 5

I am using my Desktop version of SAS. Does this mean I am using Local SAS server?

 

I think I have PC Files licensed. Here is the list:

 

For Base SAS Software ...
Custom version information: 9.4_M5
Image version information: 9.04.01M5P090617
For SAS/STAT ...
Custom version information: 14.3
For SAS/GRAPH ...
Custom version information: 9.4_M5
For SAS/IML ...
Custom version information: 14.3
For SAS/QC ...
Custom version information: 14.3
For High Performance Suite ...
Custom version information: 2.2_M6
For SAS/ACCESS Interface to PC Files ...
Custom version information: 9.4_M5
For SAS/ACCESS Interface to ODBC ...

 

 

Are you using the Local SAS server? If not, you won't have access to the C: drive of your desktop.

Do you have SAS/ACCESS to PC Files licensed? Run proc setinit and proc product_status to determine that.

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 2560 views
  • 2 likes
  • 3 in conversation