I have recently replace queries and lines of code like the following
DoCmd.OutputTo acQuery, "L001", "MicrosoftExcel(*.xls)", "\\ntoscar\t-drive\Accounting\UPS\Store Billings\" & Format(Date, "YYYY") & "\" & Format(Date, "MMM") & "\" & Format(Date, "YYMM") & "UPS-L001.XLS", False, ""
with...