I am trying to save a daily report to its current directory.
It looks as it is saving correctly however, the file is not there...
Here is the logic I am using, I just can't figure it out!
I am pulling my hair out over this!
It looks as it is saving correctly however, the file is not there...
Here is the logic I am using, I just can't figure it out!
I am pulling my hair out over this!
VBA Code:
Sub SaveDailyReport()
Dim S As Variant, MyName As String, fName() As String, fPath As String
Application.DisplayAlerts = False
MyName = Application.UserName
fName = Split(MyName, ",")
fPath = ActiveWorkbook.Path
S = Application.GetSaveAsFilename(InitialFileName:=fPath & "\" & "Daily Report" & " - " & Format(Now(), "dd-mmm-yy"), FileFilter:="Excel Files (*.xlsb), *.xlsb")
If S = False Then
MsgBox ("Hey " & fName(1) & vbNewLine & "You canceled the save" & vbNewLine & _
"Your data will be lost if you do not save!"), Buttons:=vbOKOnly + vbCritical, Title:="Save Canceled"
Exit Sub
End If
End Sub