Excel User Group
Microsoft Excel blogs, forums, files. Read, ask questions, provide answers.

How to suppress Excel Web Query URL during error

Latest post Fri, May 28 2010 11:46 PM by phuchka. 2 replies.
  • Thu, May 27 2010 2:16 AM

    • phuchka
    • Top 500 Contributor
    • Joined on Thu, May 27 2010
    • Posts 2
    • Points 26

    How to suppress Excel Web Query URL during error

    I use a web query in excel which extracts data from a URL and displays it in worksheet. Whenever the remote website is down or slow and the web query fails, the error message displays the URL along with all the parameters.

    However, I don't want to display the URL. I'd rather like a custom message displaying the name of the connection or only the URL but not the connection parameters or suppress the message altogether.

    What is the solution? At present I am not using any Macro / VBA but I am open to using it, if required.

    Thanks in Advance for any help.

    • Post Points: 21
  • Fri, May 28 2010 3:25 AM In reply to

    • Nick Hodge
    • Top 10 Contributor
    • Joined on Sun, Dec 23 2007
    • Southampton
    • Posts 543
    • Points 9,287
    • MVP

    Re: How to suppress Excel Web Query URL during error

    I am not familiar with the error mesage but if you ran the query using VBA, say from a button, does Application.DisplayAlerts = False suppress it?

    Alternatively you would need to use VBA to test the connection and if that object did not exist then you could presume the website was down. In theory at least although i think with web queries this may be tough.

    Regards
    Nick Hodge
    Microsoft MVP, Excel
    Southampton, UK

    • Post Points: 21
  • Fri, May 28 2010 11:46 PM In reply to

    • phuchka
    • Top 500 Contributor
    • Joined on Thu, May 27 2010
    • Posts 2
    • Points 26

    Re: How to suppress Excel Web Query URL during error

    This is a screenshot of the message when the URL cannot be accessed for any reason (e.g. when we are not connected with the internet or the website / URL or data is down/accessible) . 

    I have not tried Application.DisplayAlerts = False because I am not sure where to use it here (I haven't used any macro or VBA - am an excel newbie too). I am not running it from a button but the page autorefreshes the web query on opening the file. I read responses to some similar problems elsewhere where they said that Application.DisplayAlerts = False does not work in this case.

    We Query Error Message

     

     

     

     

     

     

    Your second suggestion on testing the connection should work. But for that I guess I need to write a code which does the web query from code instead of the standard excel interface. Can you point me to some VBA code snippet which does web query? I can try to modify the code to test the connection and abort with a customized message instead of displaying the whole URL.

    • Post Points: 5
Page 1 of 1 (3 items) | RSS
Copyright Excel User Group and the relevant contributors, 2010. All Trade Marks acknowledged. This site is a peer-to-peer site and NOT affiliated in any way to Microsoft Corp. All rights reserved.