ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   QUERY halts VBA (https://www.excelbanter.com/excel-programming/422122-query-halts-vba.html)

sharon

QUERY halts VBA
 
Hi,

I have a macro with 4 querys to URL files.
When I debug the macro manually it works OK, but when executing the macro,
VBA halts and wait for USER input. If I select to "Continue" everything goes
fine.

How can I avoid this step?

TIA,
Sharon

joel

QUERY halts VBA
 
What does the continue box say?

Usually if your are perfroming a query more than once you are overwriting
the previous data and the message box verifies that you want to overwrite the
previous query data. Onme solution is to write each query to its own
worksheet.

"sharon" wrote:

Hi,

I have a macro with 4 querys to URL files.
When I debug the macro manually it works OK, but when executing the macro,
VBA halts and wait for USER input. If I select to "Continue" everything goes
fine.

How can I avoid this step?

TIA,
Sharon


sharon

QUERY halts VBA
 
Hi Joel,

Message box says
"Code execution has been interrupted "
Then you have Continue, Debug or Help buttons

As said, when Continuing program runs until next halt (QUERY) and so on.

It seems to me it has relation with time between steps in the code, but I
never saw this before. Something to do with QUERY settings perhaps?



Sharon,


"Joel" wrote:

What does the continue box say?

Usually if your are perfroming a query more than once you are overwriting
the previous data and the message box verifies that you want to overwrite the
previous query data. Onme solution is to write each query to its own
worksheet.

"sharon" wrote:

Hi,

I have a macro with 4 querys to URL files.
When I debug the macro manually it works OK, but when executing the macro,
VBA halts and wait for USER input. If I select to "Continue" everything goes
fine.

How can I avoid this step?

TIA,
Sharon


sharon

QUERY halts VBA
 
Hi,

Internet is really helpful !

I found somebody had exactly the same troubles. Solution came after
inserting at the beginning of the code:

Application.EnableCancelKey = xlDisabled

All run fine now!

HTH,
Sharon

"Joel" wrote:

What does the continue box say?

Usually if your are perfroming a query more than once you are overwriting
the previous data and the message box verifies that you want to overwrite the
previous query data. Onme solution is to write each query to its own
worksheet.

"sharon" wrote:

Hi,

I have a macro with 4 querys to URL files.
When I debug the macro manually it works OK, but when executing the macro,
VBA halts and wait for USER input. If I select to "Continue" everything goes
fine.

How can I avoid this step?

TIA,
Sharon



All times are GMT +1. The time now is 01:22 PM.

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