Hi Lucausa75!
I am Shakiru, an independent advisor and a user like you, and I am glad to be helping you out today.
Try the ConvertRangeToHTMLTable function to load a range directly into a WebBrowser control using the code below:
Private Sub cmdShowPage_Click() Dim rng As Range Dim tempWB As Workbook Dim tempWS As Worksheet Dim tempHTMLFile As String
'Set the range to be loaded into the WebBrowser control Set rng = ThisWorkbook.Worksheets("Export"). Range("A1:Q19965")
'Create a new workbook and worksheet to store the range data Set tempWB = Workbooks.Add Set tempWS = tempWB.Sheets(1)
'Copy the range to the new worksheet rng. Copy tempWS.Range("A1"). PasteSpecial xlPasteAll
'Save the new workbook as an HTML file tempHTMLFile = ThisWorkbook.Path & "\temp.html" tempWB.SaveAs tempHTMLFile, xlHtml
'Navigate the WebBrowser control to the HTML file WebBrowser1.Navigate tempHTMLFile
'Cleanup: close the temporary workbook and delete the HTML file tempWB.Close False Kill tempHTMLFile End Sub
This code creates a new workbook and worksheet to temporarily store the range data. It then copies the range to the new worksheet and saves the workbook as an HTML file. Finally, it navigates the WebBrowser control to the HTML file.
Best Regards, Shakiru