Caleeco
Well-known Member
- Joined
- Jan 9, 2016
- Messages
- 980
- Office Version
- 2010
- Platform
- Windows
Hello,
I have created the following connection string to an external Excel 2010 .xlsx file:
However, If someone on the network has the file locked for editing, the file will open when I try and refresh the connection. I have tried to avoid this by changing the extended properties to always source information in READONLY mode.
But everytime I close the workbook (after saving) and then reopen it the connection string has reverted back to the old string?
#Confused
Is it better to connect to a workbook through VBA and set my own connection string everytime?
Any Help is appreciated
Thanks
Caleeco
I have created the following connection string to an external Excel 2010 .xlsx file:
Code:
Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin;Data Source=S:\2017 process\2017 main tracker.xlsm;Mode=Read;Extended Properties="Jet OLEDB:Bypass UserInfo Validation=False;Jet OLEDB:Bypass UserInfo Validation=False;HDR=YES;";Jet OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDB:Engine Type=35;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
However, If someone on the network has the file locked for editing, the file will open when I try and refresh the connection. I have tried to avoid this by changing the extended properties to always source information in READONLY mode.
Code:
Extended Properties="Jet OLEDB:Bypass UserInfo Validation=False;Jet OLEDB:Bypass UserInfo Validation=False;HDR=YES;MODE=READ;READONLY=TRUE;"
But everytime I close the workbook (after saving) and then reopen it the connection string has reverted back to the old string?
#Confused
Is it better to connect to a workbook through VBA and set my own connection string everytime?
Any Help is appreciated
Thanks
Caleeco