BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
saikiran_nemani
Obsidian | Level 7

Dear Everyone,

 

I have a task that after excel gets updated it should automatically run SAS Code.

 

Is there any way that I can do it.

1 ACCEPTED SOLUTION

Accepted Solutions
Quentin
Super User

Probably not easily... 

 

Can you explain more of the process?  What or who is updating the Excel file, is a person updating it or is there an automated process updating the Excel file?  

 

If an automated process is updating the Excel file, then probably you would want to add a step to that process so that after it updates the Excel file, it invokes a SAS job.

 

If a person is updating the Excel file, then I can imagine two options.  I'm sure there are more.  I'm going to assume that update means saves the .xlsx file.

 

You could have a scheduled SAS job (or a powershell job or whatever) that runs every hour (or 10 minutes), and checks the modified date-time of the Excel file to decide if it should process the file. 

 

If you're an excel / VBA  / powershell person, you could build an excel  button that an Excel user could click, that would execute the Excel save command and then invoke a SAS job.  So the user would be responsible for clicking that button. If you have SAS add-on for Microsoft Office, a button like that might be built in.

 

There are lots of complexities I don't address here.  For example, this assumes your Excel file is on a computer that can see your SAS environment, and vice versa.  

View solution in original post

1 REPLY 1
Quentin
Super User

Probably not easily... 

 

Can you explain more of the process?  What or who is updating the Excel file, is a person updating it or is there an automated process updating the Excel file?  

 

If an automated process is updating the Excel file, then probably you would want to add a step to that process so that after it updates the Excel file, it invokes a SAS job.

 

If a person is updating the Excel file, then I can imagine two options.  I'm sure there are more.  I'm going to assume that update means saves the .xlsx file.

 

You could have a scheduled SAS job (or a powershell job or whatever) that runs every hour (or 10 minutes), and checks the modified date-time of the Excel file to decide if it should process the file. 

 

If you're an excel / VBA  / powershell person, you could build an excel  button that an Excel user could click, that would execute the Excel save command and then invoke a SAS job.  So the user would be responsible for clicking that button. If you have SAS add-on for Microsoft Office, a button like that might be built in.

 

There are lots of complexities I don't address here.  For example, this assumes your Excel file is on a computer that can see your SAS environment, and vice versa.  

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
  • 1 reply
  • 681 views
  • 0 likes
  • 2 in conversation