Skip to content

Debugging

Tim Hall edited this page Jan 16, 2015 · 3 revisions

Debugging VBA-Web can be difficult due to the complexity of the library, but I have found the following tips helpful for for getting an idea of what's occurring under the surface:

  1. Enable logging with WebHelpers.EnableLogging = True. This will log the raw requests and responses to the Immediate Window (Ctrl + g)

  2. To better understand what's stored in Headers, UrlSegments, Cookies, Body, and other Dictionaries/Collections,
    Set a breakpoint at the issue, open Immediate Window (Ctrl + g), and use the following (? is short for Debug.Print):

    ? WebHelpers.ConvertToJSON(...Dictionary/Collection...)
    

    For example to view the Headers saved for YourRequest, use: ? WebHelpers.ConvertToJSON(YourRequest.Headers)