ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   catching cancel on QueryTable.Refresh (https://www.excelbanter.com/excel-programming/353491-catching-cancel-querytable-refresh.html)

tysop

catching cancel on QueryTable.Refresh
 
I am trying to write some code that will update a file DSN based ODBC query.
This prompts me for my username, password and datapath. However, if I click
cancelin the dialog box it just continues with the rest of the code. I want
it to alert me that Ithe operation has been cancelled and then end the code.
I have tried using err.number but it gives the same as if I confirm correct
details - no good.

Also by code it gives a second chance for entering the details before
causing an error - is there a way to catch this so it only checks once?

Many thanks
Tysop


All times are GMT +1. The time now is 12:10 PM.

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