I have found this code that saves a web page offline but it shows a dialog of save .. How can to save automatically to a desired path with prompting
Code: Select all
Sub Example()
Dim URL As String, IE As New InternetExplorer
IE.Visible = True
MsgBox IIf(SavePage(URL, ThisWorkbook.Path & "\", IE), "Page Saved", "Page Not Saved")
End Sub
Private Function SavePage(URL As String, SaveToPath As String, IE As InternetExplorer) As Boolean
On Error GoTo Err_SavePage
IE.navigate "https://locations.wendys.com/al"
'you should provide a timeout
Do
DoEvents
Loop While Not IE.readyState = 4
IE.ExecWB OLECMDID_SAVEAS, OLECMDEXECOPT_DODEFAULT
SavePage = True
Exit Function
Err_SavePage:
End Function