Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Give this a shot to get the information you want. Not Tried...
'/=================================================/ Sub Query_Info() Dim iRow As Long Dim qryTable As QueryTable Dim wks As Worksheet On Error Resume Next Worksheets.Add.Move _ After:=Worksheets(Worksheets.Count) Range("A1").Select ActiveWorkbook.ActiveSheet.Name = "Query Info" ActiveWorkbook.ActiveSheet.Range("A1").Value = _ "Query Name" ActiveWorkbook.ActiveSheet.Range("B1").Value = _ "Connection" ActiveWorkbook.ActiveSheet.Range("C1").Value = _ "SQL" For Each wks In Worksheets For Each qryTable In wks.QueryTables iRow = iRow + 1 ActiveCell.Offset(iRow, 0).Value = _ qryTable.Name ActiveCell.Offset(iRow, 1).Value = _ qryTable.Connection ActiveCell.Offset(iRow, 2).Value = _ qryTable.Sql Next qryTable Next wks End Sub '/=================================================/ HTH, Gary Brown "Pavils Jurjans" wrote: Hello, I have this Excel file with a spreadsheet with external data range. It was given to me to work though the associated SQL query remotely. Unfortunately, when I click "Edit Query", I get message that ODBC data source could not be found. Currently I have no copy of the data, but I'd be willing to study (and perhaps update) the SQL query. Is there any way to retrieve the SQL query that is saved in my Excel file, via other means, for example, using VBA? Thanks, Pavils |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to modify the web link for retrieving data from external sourc | Excel Discussion (Misc queries) | |||
How to modify the web link for retrieving data from external sourc | Excel Worksheet Functions | |||
Retrieving External Data from Access into Excel | Excel Programming | |||
Retrieving External Data from Access | Excel Programming | |||
Retrieving external data | Excel Programming |