Hi all,
I'm using VBA to export a query to Excel. The path is a OneDrive location that is synced to all of our C: drives. It works for me, but when other users try to export it gives them an error because the path has my username (Mateyr).
My question is - what syntax can I use to replace my username so it works for everyone?
Code:DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "qry_Product_Name", "C:\Users\Mateyr\ABC\Documents\Database\rpt_Product_Name.xlsx", True