VBA Code:
Sub SaveAndClose()
Dim TimePath As String '/ Declaring file path name
Dim MyName As String '/ Declaring file name
Current_date = Format(Now, "MMDDYY_hhmmss") '/ Assigning date & Time to use in file name
MyName = ActiveWorkbook.Name '/ Assigning file name of current active workbook
TimePath = "G:\TECH\ib271t0o\MyBackups\" & MyName & "-" & Current_date & ".xlsm" '/ Buliding full path name for backup file
ActiveWorkbook.SaveAs Filename:=TimePath '/ Saving backup file
ActiveWorkbook.Close SaveChanges:=True '/ Saving any changes and closeing current active workbook
Workbooks("PERSONAL.XLSB").Close SaveChanges:=False '/ Closing PERSONAL workbook
End Sub
After this Marco completes Excel stays open and the particular workbook that this code is in re-opens. I do not want to run the code to quit Excel because the user may have other workbooks open.