Hi,

I've a code to import a Json text to excel.

There is a way to do a web request to login to the site (probably get cookies too) and parse directly the json url?

Code:
Sub ConverterJsonEfatura()
Dim jsonText As String
Dim jsonObject As Object, item As Object
Dim i As Long
Dim ws As Worksheet

Set ws = Worksheets("Folha1")

jsonText = ws.Cells(1, 1)

Set jsonObject = JsonConverter.ParseJson(jsonText)

i = 3

For Each item In jsonObject("linhas")
    ws.Cells(i, 1) = item("idDocumento")
    ws.Cells(i, 2) = item("origemRegisto")
    ws.Cells(i, 3) = item("origemRegistoDesc")
    ws.Cells(i, 4) = item("nifEmitente")
    ws.Cells(i, 5) = item("nomeEmitente")
    ws.Cells(i, 6) = item("nifAdquirente")
    ws.Cells(i, 7) = item("nomeAdquirente")
    ws.Cells(i, 8) = item("tipoDocumento")
    ws.Cells(i, 9) = item("tipoDocumentoDesc")
    ws.Cells(i, 10) = item("numerodocumento")
    ws.Cells(i, 11) = item("dataEmissaoDocumento")
    ws.Cells(i, 12) = item("valorTotal") / 100
    ws.Cells(i, 13) = item("valorTotalBaseTributavel") / 100
    ws.Cells(i, 14) = item("valorTotalIva") / 100

    i = i + 1
Next

End Sub
Thanks in advance.

https://faturas.portaldasfinancas.go...aoFilter=TODOS

Regards,