List ConnectionString of linked, external Excel file

  • Thread starter Thread starter Steve Blake
  • Start date Start date
S

Steve Blake

I am in need of verifying the linked excel tables (external Excel files) are proper. I am setting the connectionStrins in VBA and the customer can easily change those links. Therefore, I need to verify links are proper to proceed with automated analysis.

Is there a way to get a debug.print list of all externally linked file "Paths"?

Thanks
 
Update: I have attempted to look at one table (linked external XL file) with the following code:

Sub ListConnectString()
With ActiveWorkbook.Connections("tblExceptions").OLEDBConnection
Debug.Print .Connection
End With
End Sub

However when run I get...
OLEDB;Provider=Microsoft.ACE.OLEDB.12.0;Password="";User ID=Admin;Data Source=;Mode=Share Deny Write;Extended Properties="";Jet OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDB:Database Password="";Jet OLEDB:Engine Type=6;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

As you can see, the "Data Source= 'nothing'"... Any suggestions?

Again, Thinks.
 
Problem Resolved. I looked at the table and found that it had lost it's link. Once reestablished, the above code would allow me to read the existing link Path.

Enjoy
 
Back
Top