Hello
I want to send an email from SAS and attach a file.
I receive an error
ERROR: Error opening attachment file \\path\Report.xlsx.
ERROR: Physical file does not exist, \\path\Report.xlsx.
I check and the path is correct so I cannot understand what is the problem.
How can I check if the problem is with my authorization?
data _null_;
file sendit email
from="XXX@gmail.com"
to=("YYY@gmail.com")
subject="Important Document"
importance="High"
attach=("\\path\Report.xlsx");
put "Please find attached the file";
put;
put "Thanks!";
run;
Could you please check the path again. I believe this is not the correct path, could you share the screenshot of the actual path
\\path\Report.xlsx
The path is 100% correct.
I changed it in the post because I cannot write path of my work
Can you read anything from this path via a "normal" libname or filename statement?
Have you by any chance the Excel opened via another application (i.e. via a local MS Excel)?
Hello
Excel file is not opened
Path is correct (If I go to start and paste the path then i can see the excel file)
@Ronein wrote:
Hello
Excel file is not opened
Path is correct (If I go to start and paste the path then i can see the excel file)
I assume you can see the path from your local machine. If SAS isn't installed on your local machine then this doesn't tell you if this path is also correct on the machine where SAS executes - that's why I've asked you if you're able to execute any filename or libname statement using this path. Just try: libname test '\\path'; This will already tell you if the path as such is accessible from the SAS side.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.