I have made an excel workbook consisting of several complex worksheets.
Now I have created queries using MS query to allow me to gather the information needed for calculations from these different worksheets. Everything works just fine until I move the workbook to a new location.
As this is going to happen often and I do not want to rebuild my queries every time I was wondering if there is a way to link my query to the workbook itself and not to a specific file location.
Can anybody help me?
This is de SQL build up of the query
SELECT `'Production Plan$'`.`Scheduled Operation`, `Tests$`.`Test Name`, `Tests$`.`Tests per batch`, `Tests$`.`Ops PER BATCH or PER YR:`, `Tests$`.`Total Locations (MULTIPLIER):`, `Tests$`.`Retest Rate`, `'Production Plan$'`.`Batches for 2015`, `'Production Plan$'`.`Batches for 2016`, `'Production Plan$'`.`Batches for 2017`, `'Production Plan$'`.`Batches for 2018`
FROM `C:\Users\UGent\Desktop\XXX\XXX\Models\new model SV 0106.xlsx`.`'Production Plan$'` `'Production Plan$'`, `C:\Users\UGent\Desktop\XXX\XXX\Models\new model SV 0106.xlsx`.`Tests$` `Tests$`
WHERE `'Production Plan$'`.`Scheduled Operation` = `Tests$`.`Scheduled Operation:`
And this is the connection string
DSN=Excel Files;DBQ=C:\Users\UGent\Desktop\BQG\Genzyme\Models\new model SV 0106.xlsx;DefaultDir=C:\Users\UGent\Desktop\BQG\Genzyme\Models;DriverId=1046;MaxBufferSize=2048;PageTimeout=5;