Spreadsheet with a webbrowser on it. Need to navigate to a web page, save it to a file locally then reload it from the file later.
This is my code:-
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal _
szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Dim returnvalue As Long
dim url,filename as string
url = Sheet1.WebBrowser1.LocationURL
filename = "c:\testfile.htm"
returnvalue = URLDownloadToFile(0, url, filename, 0, 0)
When running the Save Sub it seems to work ok and saves the file however when click to re-load from file it takes about 30-40 seconds to load. It loads most of it then freezes for ages then finally loads the last little bit. Strangely it only does this when the computer is connected to the internet. If the internet is disconnected then it re-loads the page instantly without any problems. This isn't really practical though as I need to re-load the page instantly without having to disconnect or wait for ages every time.
Tried loading the saved file into IE when online it brings up warnings about active x and scripts running, I clicked to allow content and it eventually loads after about 30 seconds.
Any ideas on how to solve this would be greatly appreciated.