Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
database calls
If there's no direct ADO/DAO calls, what about QueryTables ?
Run this code to see what you get: Private Sub CommandButton2_Click() Dim WS As Worksheet Dim QT As QueryTable Dim QTCount As Long For Each WS In ThisWorkbook.Worksheets For Each QT In WS.QueryTables Debug.Print QT.Parent, QT.CommandText QTCount = QTCount + 1 Next Next MsgBox "There are " & QTCount & " query tables in this workbook." End Sub NickHK "Panos Stavroulis." wrote in message ... Hi, I am trying fix an error message from the database coming into excel after you press a button, ie run a macro. It produces some syntax error on the database and it fails. I can see that the button is assigned to a macro, then I can see all macros and I've searched through them for opening database connections, ie ADO calls. I can't see anything connecting to a database. Also profiler on SQL Server doesn't show anything (maybe the request goes to the wrong server?) I can't see any external data queries either. What else is in an excel file that can make calls to a DBMS? Thanks. Panos. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
database calls
That worked thanks. I still can't see the queries, something with my odbc
set-up but at least now I can see the sql code. Thanks. "NickHK" wrote: If there's no direct ADO/DAO calls, what about QueryTables ? Run this code to see what you get: Private Sub CommandButton2_Click() Dim WS As Worksheet Dim QT As QueryTable Dim QTCount As Long For Each WS In ThisWorkbook.Worksheets For Each QT In WS.QueryTables Debug.Print QT.Parent, QT.CommandText QTCount = QTCount + 1 Next Next MsgBox "There are " & QTCount & " query tables in this workbook." End Sub NickHK "Panos Stavroulis." wrote in message ... Hi, I am trying fix an error message from the database coming into excel after you press a button, ie run a macro. It produces some syntax error on the database and it fails. I can see that the button is assigned to a macro, then I can see all macros and I've searched through them for opening database connections, ie ADO calls. I can't see anything connecting to a database. Also profiler on SQL Server doesn't show anything (maybe the request goes to the wrong server?) I can't see any external data queries either. What else is in an excel file that can make calls to a DBMS? Thanks. Panos. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Calls per Day | Excel Discussion (Misc queries) | |||
database calls | Excel Programming | |||
Concurrent Calls | Excel Programming | |||
XLA calls dll | Excel Programming | |||
VBA Calls | Excel Programming |