I', trying to copy and paste the whole HTML body to excel worksheet. For now i have this
Sub audycje()
Dim strona As Object
Dim adres As String
Dim wb As Workbook
Dim a As String
Set strona = CreateObject("InternetExplorer.Application")
Set wb = ThisWorkbook
adres = InputBox("Podaj adres strony")
strona.navigate (adres)
wb.Worksheets("Dane").Range("B2") = strona.body.innerHTML
strona.Quit
End Sub
Just cant get the HTML to be inserted into excel ;/
[EDIT]
I got this and it's working ok but...
Sub audycje()
Dim strona As Object
Dim adres As String
Dim wb As Workbook
Dim a As Object
Set strona = CreateObject("InternetExplorer.Application")
Set wb = ThisWorkbook
adres = InputBox("Podaj adres strony")
If adres = "" Then
MsgBox ("Nie podano strony do za?adowania")
Exit Sub
End If
strona.Visible = True
strona.navigate (adres)
wb.Worksheets("Dane").Range("B2") = strona.document.body.innerHTML
End Sub
The whole HTML body is in one cell. How to spread it ?
question from:
https://stackoverflow.com/questions/65832333/how-to-extract-html-source-code-to-excel-vba 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…