Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Fredrik,
We need to create a QueryTable because there are other formulas that are referenced to the data in the Query. That is the reason we need to make a QueryTable instead of copying the values. We put in a excel formula a user defined function (function 1), this function calls another one to create a Query Table (function 2). The correct order is the following: 1st - lista function is called and executed. It calls CreaConsulta funtion. 2nd - CreaConsulta makes a QueryTable, if it is created ok, it returns TRUE if not it returns FALSE. 3rd - The code returns to the function lista in order to end the rest of the code that is to return de value returned by CreaConsulta in the value property of the cell in excel. For example: You put in A1 the following lista("select * from table1") lista calls CreaConsulta and creates the QueryTable, if its created A1.value will be TRUE otherwise will be FALSE. And if the QueryTable has been created, it will be in B1 cell. The problem is only that when you get to the refresh method in CreaConsulta, insted of continuing the code from that point, Excel interrups the executing code in order to begin executing again the function lista from the beginning and that reaction makes that the code is not executing correctly because there is always part of the code without being runned. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Web Query using a QueryTable via HTTPS?? | Excel Programming | |||
Excel 2003: Can the same range be used for a querytable and a list | Excel Programming | |||
Excel - VBA - QueryTable error 1004 | Excel Programming | |||
ODBC / OLE DB QueryTable Editor Add-In for Excel | Excel Programming |