Please help!!
Hi everyone,
I am trying to put in this peace of code, but it keeps failing on me. I am not an expert, so the error might be everywhere.
I tried the below, but for some reason, it keeps on crashing on the saving bit. Can someone please have a look at my code and tell me where it goes wrong?
Thank you so much.
Sub Mail()
myFile = "Action log_" & Now()
ThisWorkbook.ActiveSheet.Copy
ActiveWorkbook.SaveAs Filename:="G:\Structureren ML_2" & myFile
ThisWorkbook.Activate
If Not IsNull(Application.MailSession) Then Application.MailLogon
With ThisWorkbook.Worksheets("Dependencies").Cells
For Each c In .Range("D3:D12").Cells
s = c.Value
If s = "" Then GoTo Skip
Workbooks(myFile & ".xls").SendMail Recipients:=s, _
Subject:="Here is an UPDATED Action log #" & Range("H1").Value, _
ReturnReceipt:=False
Skip:
Next c
End With
Workbooks(myFile & ".xls").Close False
Kill "C:Windowstemp" & myFile & ".xls"
End Sub