Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Code to do a Web-download

In an addin I employ some commonly used Web-download code as shown
below:


Public Function DownloadFile(sDlNetFileAddy As String, _
sDlUserPath As String) As Boolean
DownloadFile = URLDownloadToFile(0&, sDlNetFileAddy, _
sDlUserPath, BINDF_GETNEWESTVERSION, 0&) = ERROR_SUCCESS
DoEvents
End Function


Along with the supporting code, it works well, but my concern is for
those people with really slow connections. I'm concerned it may cause a
runtime error if it takes too long.

Any thoughts on this? Is there a way I can set a timeout variable?

Thanks,
Chuck

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default Code to do a Web-download

Chuck,

See my last few posts and keep an eye on that thread.

IF I can get around the problem with registering a winsock I'll post a
solution in which you can monitor how much of the file has been downloaded.
I have it working on one box and it's very easy to use. Likewise, part of my
reason for doing this was a recent experience of a slow connection and an
inability to do anything but sit there and wait for the command to finish.

Yours,

Robin Hammond
www.enhanceddatasystems.com

"c mateland" wrote in message
oups.com...
In an addin I employ some commonly used Web-download code as shown
below:


Public Function DownloadFile(sDlNetFileAddy As String, _
sDlUserPath As String) As Boolean
DownloadFile = URLDownloadToFile(0&, sDlNetFileAddy, _
sDlUserPath, BINDF_GETNEWESTVERSION, 0&) = ERROR_SUCCESS
DoEvents
End Function


Along with the supporting code, it works well, but my concern is for
those people with really slow connections. I'm concerned it may cause a
runtime error if it takes too long.

Any thoughts on this? Is there a way I can set a timeout variable?

Thanks,
Chuck



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
items chosen to download are NEVER all there after download comple jwhitehurst New Users to Excel 3 November 9th 07 04:00 PM
Useful add-ins to download [email protected] Excel Discussion (Misc queries) 0 March 17th 06 04:21 AM
how do i download again i have key code remo85414 Excel Discussion (Misc queries) 1 December 19th 05 04:43 AM
Download No Name Excel Programming 1 October 1st 04 09:15 AM
VBA code for automatic download shekar Excel Programming 1 August 14th 04 05:28 PM


All times are GMT +1. The time now is 11:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"