BookmarkSubscribeRSS Feed
Sasuser52
Fluorite | Level 6

What is the best way to import (or read) an Excel file from within an interactive SAS session while the same Excel file has simultaneously been opened by the same user?

 

(I have the impression that this is possible when the Excel file is on a remote server share, but not for files which are located at the local drive.)

4 REPLIES 4
Quentin
Super User

By "interactive session" you mean old-fashioned PC SAS with display manager, running locally?   Certainly PC SAS is happy to read Excel files stored locally.

Sasuser52
Fluorite | Level 6

Yes, I mean old-fashioned PC SAS with display manager, running locally. 😉

ballardw
Super User

Proc Import does not handle files that are opened by an application that 'locks' access to a file.

So I suspect you will not be able to get that approach to work.

 

A very old, fragile, no longer supported by Microsoft approach using DDE may work. I'm not going to provide any example as some of the code elements are actually dependent on which Office/ file version is used.

 

A real question would be "why must the file be open"?

Sasuser52
Fluorite | Level 6

Thank you for your answer. 😊 I guess there is no nice way to do this. It would be convenient to have it. Now I have a lot of closing the Ecxel file, running a SAS programm, opening the Excel file, changing something, closing the file, running the SAS programm, opening the file ....

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 4 replies
  • 1037 views
  • 0 likes
  • 3 in conversation