I have a macro saving a file that has a date and time stamp suffix. Because that folder had spaces in the folder path it was screwing up the link that I was trying to place in an automated email. How do I edit the code in the email to directly point to the filename that was saved with the date and time stamp suffix?
'Save file to FName2
Application.DisplayAlerts = False 'use if overwritting file to nix popup
Dim FName2 As String
' L-learned do not use lettered drives
FName2 = "\\na\Global-Groups\Holland\Operations\Logistics\DSC\Go to Work Signals\RePlan Report\AM PM RePlan Report "
FName2 = FName2 & Format(Date, "yyyy.mm.dd") & " " & Format(Time, "hhmm") & ".xlsx"
ActiveWorkbook.SaveAs Filename:= _
FName2, FileFormat:= _
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
.To = strto
.CC = ccto
.BCC = bccto
' .Subject = Format(Now, "dd-mmm-yy h:mm:ss")
.Subject = Worksheets("EmailForReplanRpt").Range("J1") & " " & Format(Now, "mmm-dd-yyyy h:mm:ss") 'of listed s-sheet use J1 as Subject
.Body = "DSC Replan Report is complete and ready for review. No issues. " & vbNewLine & _
"Report can be found: \\na\Global-Groups\Holland\Operations\Logistics\DSC\Go_to_Work_Signals\Replan_Report\ " & vbCrLf & vbNewLine & _
"For adds and deletes to this email, please advise. Thanks." & vbCrLf & _
"Runtime: " & Format(DateDiff("s", dtStart1, dtEnd1) / 86400, "HH:MM:SS")