AnsweredAssumed Answered

Excel not attaching to send mail

Question asked by ndveitch on Apr 6, 2018
Latest reply on Apr 6, 2018 by ndveitch

Hi there,

 

I need to find out what I am doing wrong in my script. I have a script that I have scheduled on the FM server to run every morning. The script does a find, save to Excel, attach the excel to an email, and send the email. When I run the script normally everything works fine, but when the server runs the script it does not attach the excel.

 

 

         Sort Records [ Restore ; With dialog: Off ]

         #

         Set Variable [ $excel ; Value: Get ( TemporaryPath ) & "Creditors invoiced before File opened on " & Substitute ( Get ( CurrentDate ) ; "/" ; "-" ) & ".xlsx" ]

         Save Records as Excel [ Restore ; With dialog: Off ; “$excel” ; Records being browsed ]

         #

         Pause/Resume Script [ Duration (seconds): 20 ]

         #

         Send Mail [ Send via SMTP Server ; No dialog ; To: "admin@work.co.za" ; CC: "nathan@work.co.za" ; Subject: "Creditors invoiced before File Opened on " & Substitute ( Get ( CurrentDate ) ; "/" ; "-" ) ; Message: "Hi Admin,"  & ¶ & ¶ & "Please find attached the excel report of any creditor invoices that have been captured, but the file was opened after."  & ¶ & ¶ & "Regards,” ; “$excel” ]

 

 

What am I doing wrong? I even saw something about adding a pause in before the send mail, but that still is not working. 

Outcomes