none
Excel crashes refreshing a web query that makes a POST request RRS feed

  • Question

  • Create a web query from VBA which has a POST request. Excel will crash and exit when the query runs, or when it is first refreshed if created with BackgroundQuery: True.

    To reproduce: run the following VBA macro in an empty worksheet in Excel 2016

    Sub CrashExcel
    Dim Query as Object
    Set Query = ActiveSheet.QueryTables.Add(Connection:="URL;https://www.w3schools.com/html/html_tables.asp", Destination:=ActiveCell)
    Query.PostText = "param=[""param"",""Enter param""]"
    Query.Refresh
    End Sub

    After supplying a value for the POST parameter (for example type "1" into the popup dialog) Excel will crash and exit


    Friday, June 22, 2018 3:53 PM

All replies

  • Hi,

    This is the forum to discuss questions and feedback for Microsoft Excel features, I'll move your question to the MSDN forum for Excel

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

    Regards,

    Emi


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Monday, June 25, 2018 6:37 AM
  • In a conversation with "Frank Z" on Friday I was given this link when I asked how to raise a bug report against Excel: https://social.technet.microsoft.com/Forums/en-US/home?category=officeitpro

    Was that incorrect guidance?

    Monday, June 25, 2018 8:54 AM
  • Hello Martin de S,

    Office It Pro forums are for discussing issues about Office product feature and this forum(Excel for Developers) is for development issue related to Excel. Since your thread use VBA code, it is moved to current forum.

    I could reproduce your issue but I'm wondering why do you use the "param=[""param"",""Enter param""]" PostText. Is it a correct post text? I tried some other post text, such as "1". It maybe not a correct post request but it does not crash the excel. I could see that your post text called an input dialog. What's that?

    Except Excel, could you use other tool to use the post text to return your result?

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, June 26, 2018 9:41 AM
  • Regarding my choice of forum, when I described this bug in an online chat with Microsoft support, I was instructed to post in the technet forum.

    Frank Z
    Thank you for contacting Microsoft Support. I am Frank Z. How can I help you today?
    ...
    Me
    I have a bug to raise with Excel 2016

    Me
    Excel crashes and exits when refreshing a web query that makes a POST request
    ...
    Frank Z
    You may also post it on office forum

    Frank Z
    https://social.technet.microsoft.com/Forums/en-US/home?category=officeitpro

    If that wasn't correct, perhaps Microsoft should update their online support script

    You're quite right, "1" isn't a correct POST request (even though it doesn't crash Excel).  POST text is usually of the form "parameter=value".  This will set a fixed parameter value for the request. 

    There is an alternative format (as explained here https://msdn.microsoft.com/en-us/library/office/aa203721%28v=office.11%29.aspx?f=255&MSPPError=-2147217396) where the parameter is specified with "parameter=[""default value"",""prompt""]": when using this format it is added as a parameter to the QueryTable object's Parameters collection.  This will prompt the user to provide a value for the parameter, which is the input dialog you saw.  Refreshing a web query which has a parameterised POST text like this will crash Excel.

    I'm sure I could use some tool other than Excel to return the data but my question is about Excel.

    Tuesday, June 26, 2018 5:08 PM
  • Hello Maritin de S,

    What's the version of your office? I was able to reproduce your issue yesterday. However, after updating my Office to the latest version Version 1806 (Build 10228.20080) today. It seems works well now.

    I would suggest you to try to update your office to last version to check if the issue still exist.

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, June 28, 2018 3:06 AM