Find the contents of a Connection property of the QueryTable objec

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Greetings,

How can I determine the contents of Connection property of the QueryTable
object in a Worksheet and if there are several queries in the same Worksheet?.

Thank you in advance for your support.
 
hi,
finding querys:
query tables show up as range names. so goto
Insert>names>define
if querytable are present, they will show up here. click
on one and the range will appear in the box at the bottom.
or you can use the navigator. in the upper left of the
sheet, click the down arrow. the query range should be
listed. click on one and it will take you to the query
table. you must do this for each sheet.
connection Property:
click inside the query range and goto
Date>Get external Date >edit query.
(if the wizard comes up, toggle to the last page and click
view data or edit query in Microsoft query.)
when microsoft query comes up, click view>sql.
this will be the connection.
Regards
Frank
 
Frank,

Thank you for the prompt response and the information you provided. I was
hopping to get more information on how to accomplish this task
programmatically. I have 480 Queries that I must modify regularly, which
becomes a cumbersome task.
 
Dim ws As Worksheet
Dim qtbl As QueryTable

For Each ws In ActiveWorkbook.Worksheets
For Each qtbl In ws.QueryTables
With qtbl
Msgbox .Connection
End With
Next qtbl
Next ws
 
Thank you Dianne,
This solution worked fine!.

Thank you again for your response.
 

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

Back
Top