ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   List ConnectionString of linked, external Excel file (https://www.excelbanter.com/excel-programming/449101-list-connectionstring-linked-external-excel-file.html)

Steve Blake[_2_]

List ConnectionString of linked, external Excel file
 
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

Steve Blake[_2_]

List ConnectionString of linked, external Excel file
 
Update: I have attempted to look at one table (linked external XL file) with the following code:

Sub ListConnectString()
With ActiveWorkbook.Connections("tblExceptions").OLEDBC onnection
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.

Steve Blake[_2_]

List ConnectionString of linked, external Excel file
 
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


All times are GMT +1. The time now is 06:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com