List ConnectionString of linked, external Excel file

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
 
S

Steve Blake

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.
 
S

Steve Blake

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top