View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
tysop tysop is offline
external usenet poster
 
Posts: 5
Default 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