Is there anyway I can apply some code to a workbook so that a query on a worksheet is automatically refreshed when the workbook is saved and closed by the user?

It's necessary to do it this way round as opposed to refresh query on open as the user is inputting data to the workbook which is linked to a database that consolidates other workbooks in one table.

Thank you.