I've studied Croc's macro, and found really cool to change the path to external data to relative from absolute.
I used to store my Visio drawings in the folder, Documents\Visio Drawings, and Excel books in Documents\Excel Books.
So I changed just a line of Croc's macro,
from
to
s3 = Replace(s, s2, "..\Excel Books\")
After I run the macro and confirmed the relative path is really applied as
Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin;Data Source=..\Excel Books\HLG300x81Weight History.xlsx;Mode=Read;Extended Properties="HDR=YES;IMEX=1;MaxScanRows=0;Excel 12.0;";Jet OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDB:Engine Type=37;Jet OLEDB:Database Locking Mode=0;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False;Jet OLEDB:Support Complex Data=False;Jet OLEDB:Bypass UserInfo Validation=False;Jet OLEDB:Limited DB Caching=False;Jet OLEDB:Bypass ChoiceField Validation=False
Really got "Data Source=..\Excel Books\HLG300x81Weight History.xlsx".
Of course, you can refresh data, and
relative path is kept after that.
Very cool!