Q:

how to insert a value in a html space box by vba

I am trying to insert a specific value at 3 differents space boxes. However, I did not find a example that works with the site which I am using.
Site: http://www.b3.com.br/pt_br/market-data-e-indices/indices/indices-de-segmentos-e-setoriais/serie-historica-do-di.htm
Sub Download()

Dim user, password As Variant

Application.ScreenUpdating = False

'Planilha Ativa
Worksheets("Realizado").Activate

'Abrir a página da BMF
Set ie = CreateObject("InternetExplorer.Application")
    ie.navigate "http://www.b3.com.br/pt_br/market-data-e-indices/indices/indices-de-segmentos-e-setoriais/serie-historica-do-di.htm"
    ie.Visible = True

ie.Document.all.Item("DT_DIA_DE").Value = "02"
ie.Document.all.Item("DT_MES_DE").Value = "01"
ie.Document.all.Item("DT_ANO_DE").Value = "2019"

Application.ScreenUpdating = True

End Sub

A:

Internet Explorer:
It is inside an iframe. You could initially navigate direct to the src source for the iframe with
.Navigate2 http://estatisticas.cetip.com.br/astec/series_v05/paginas/lum_web_v05_template_informacoes_di.asp?str_Modulo=completo&int_Idioma=1&int_Titulo=6&int_NivelBD=2

Or, select the iframe element and navigate to its src
Option Explicit
'VBE > Tools > References: Microsoft Internet Controls
Public Sub NavigateLinks()
    Dim ie As New InternetExplorer
    With ie
        .Visible = True
        .Navigate2 "http://www.b3.com.br/pt_br/market-data-e-indices/indices/indices-de-segmentos-e-setoriais/serie-historica-do-di.htm"

        While .Busy Or .readyState < 4: DoEvents: Wend
        .Navigate2 .document.getElementById("bvmf_iframe").src
        While .Busy Or .readyState < 4: DoEvents: Wend
        With .document
            .querySelector("[name='DT_DIA_DE']").Value = "02"
            .querySelector("[name='DT_MES_DE']").Value = "01"
            .querySelector("[name='DT_ANO_DE']").Value = "2018"
            .querySelector("[href*='EnvioChecaDados']").Click
        End With
        Stop
        .Quit
    End With
End Sub

XHR (XMLHttpRequest):
The page does a POST form XHR request to this url:
http://estatisticas.cetip.com.br/astec/series_v05/paginas/lum_web_v04_10_03_consulta.asp

You could attempt to replicate that request and avoid a browser altogether. If you manually make the request on the page and inspect the network tab via dev tools (F12 - Chrome), you will find that url. The POST form parameters are all shown including the date parts:

Click download:
.document.querySelector(".primary-text a").click

