ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find the contents of a Connection property of the QueryTable objec (https://www.excelbanter.com/excel-programming/314760-find-contents-connection-property-querytable-objec.html)

SPYREN

Find the contents of a Connection property of the QueryTable objec
 
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.

Frank Stone

Find the contents of a Connection property of the QueryTable objec
 
hi,
finding querys:
query tables show up as range names. so goto
Insertnamesdefine
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
DateGet 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 viewsql.
this will be the connection.
Regards
Frank
-----Original Message-----
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.
.


SPYREN

Find the contents of a Connection property of the QueryTable objec
 
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.



"Frank Stone" wrote:

hi,
finding querys:
query tables show up as range names. so goto
Insertnamesdefine
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
DateGet 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 viewsql.
this will be the connection.
Regards
Frank
-----Original Message-----
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.
.



Dianne Butterworth[_2_]

Find the contents of a Connection property of the QueryTable objec
 
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

--
Dianne Butterworth

SPYREN wrote:
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.




SPYREN

Find the contents of a Connection property of the QueryTable o
 
Thank you Dianne,
This solution worked fine!.

Thank you again for your response.




"Dianne Butterworth" wrote:

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

--
Dianne Butterworth

SPYREN wrote:
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.






All times are GMT +1. The time now is 12:21 AM.

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