BookmarkSubscribeRSS Feed
Dreamer
Obsidian | Level 7

Hi All,

 

I am trying to import a Macro enabled Excel file (xlsm).

I am using following code to do this:

PROC IMPORT DATAFILE='/home/Excelfile.xlsm'  
DBMS=xlsx replace
OUT=work.test ;
SHEET="Sheet1";
GETNAMES=YES;
RUN;

But it shows following error:
ERROR: XLSX file does not exist -> /home//Excelfile.xlsm.xlsx

 

I don't understand why its adding extra "/" and "xlsx" around the file name.

This code works fine for a "xlsx: file format.

I am using SAS 9.3 and EG 5.1

 

Can anyone help me in reading a xlsm file format?

 

Any help will be much appreciated.

 

Thanks in advance!!

5 REPLIES 5
art297
Opal | Level 21

Have you tried simply changing the line that is currently: dbms=xlxs

to

dbms=excel

 

Dreamer
Obsidian | Level 7

Yes, but also didn't work.

Dreamer
Obsidian | Level 7

This file is delivered from a different source and I have only read access to it.

I can write VBA to save this file as XLSX to some different location and then point SAS to read it from there.

But before doint that first I want confirm that there is no way I can read a XLSM file through SAS.

Kurt_Bremser
Super User

It might be that the .xlsm format is only supported on Windows, as a VBA engine is needed to run the macros. And since even pre-ODF macros (Excel 4.0) are supported, I suspect that the .xlsm format may contain all kinds of (insert suitable 4-letter expletive here).

 

BTW, I don't see ANY reasson why a simple transfer of data needs macros. There seems to be a serious process design flaw here.

 

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 9116 views
  • 1 like
  • 3 in conversation