Having the program quit excel resulted in some issues so changing it so that it only closes the workbook after a save instead.