I am looking for a line of VBA code to use after I execute code to go into a secondary file to make an update and then “save (as new file) and close” the secondary file without having to get the exit message that asks me if I want to save the file. I am currently using the following lines in a “BeforeClose” event. Target lines are stepped through when I close the workbook either from within the secondary file and when I close from the first file. However, it only works when I am closing from within the secondary file. If I am in the first file and then run code to execute the closing of the second file line of code in the “BeforeClose” event steps through accordingly, but does not execute the following lines.
With ThisWorkbook
.SaveAs [NewFileSaveName]
.Close savechanges:=False
End With
Is there a better way of handling this process?
With ThisWorkbook
.SaveAs [NewFileSaveName]
.Close savechanges:=False
End With
Is there a better way of handling this process?