I think the problem here is with reference to new workbook which is opened in the new Excel Application. This is the part of the code were is the error.
If to change nb.ActiveSheet.QueryTables.Add
to ActiveSheet.QueryTables.Add
everything works (but in current workbook, not in nb).
It must execute in the new workbook not in current one.
Dim app As New Excel.Application, nb As Excel.Workbook
Set nb = app.Workbooks.Add
With nb.ActiveSheet.QueryTables.Add(Connection:= _
"URL; http://www.example.com", _
Destination:=Range(Cells(2, 2), Cells(57, 3)))
End With