Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello All,
I am using the following code to download web pages and files from the internet to a designated drive. ============ Private Declare Function URLDownloadToFileA Lib "urlmon" (ByVal pCaller As Long, _ ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, _ ByVal lpfnCB As Long) As Long Private Function DownloadFile(URL As String, LocalFilename As String) As Boolean Dim lngRetVal As Long lngRetVal = URLDownloadToFileA(0, URL, LocalFilename, 0, 0) If lngRetVal = 0 Then DownloadFile = True End Function ============ It works great. All sorts of web pages and files are downloaded to the computer. Here is where I am running into a snag. I am trying to download a web page. If you manually navigate to this particular web page, the web page appears to be querying a system, brings back data, and displays it as a table. This takes a several seconds for the web page to produce this data. My code (above) downloads the web page before it has had time to "refresh" with the data. Can someone point me to some code that would "refresh" the designated web page and then wait until the data is brought back? Thank you for your help. MSweetG222 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It's possible that the page is being built dynamically in the browser:
if this is the case then you won't get the full page using your current method. You'd need to do something like automate IE to get that kind of content. Google "automate IE" in gooogle groups and you'll get plenty of examples, many of them from this group. Tim On Sep 18, 8:47*am, MSweetG222 wrote: Hello All, I am using the following code to download web pages and files from the internet to a designated drive. * ============ Private Declare Function URLDownloadToFileA Lib "urlmon" (ByVal pCaller As Long, _ ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, _ ByVal lpfnCB As Long) As Long Private Function DownloadFile(URL As String, LocalFilename As String) As Boolean * * Dim lngRetVal As Long * * lngRetVal = URLDownloadToFileA(0, URL, LocalFilename, 0, 0) * * If lngRetVal = 0 Then DownloadFile = True End Function ============ It works great. *All sorts of web pages and files are downloaded to the computer. * Here is where I am running into a snag. *I am trying to download a web page. *If you manually navigate to this particular web page, the web page appears to be querying a system, brings back data, and displays it as a table. *This takes a several seconds for the web page to produce this data. *My code (above) downloads the web page before it has had time to "refresh" with the data. Can someone point me to some code that would "refresh" the designated web page and then wait until the data is brought back? Thank you for your help. MSweetG222 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delay opening files from Taskbar | Excel Discussion (Misc queries) | |||
delay in opening excel files | Excel Discussion (Misc queries) | |||
Excel 2007 will not download training practice pages....help! | New Users to Excel | |||
Batch file to start multiple excel files with auto_open() macro. Delay code needed | Excel Programming | |||
Download files with excel | Excel Programming |