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.
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.
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.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.