Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How do I load a file from URL

Very simple question ...

what methods are there to load a file from a URL and then store it in a
filesystem file?

I'm doing this from VBA excel, but dont actually want (need) the
information inside of excel - but that is where I need to initiate the
transfer.

A quick pointer to an approrpiate library/class would be appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.programming
MaC MaC is offline
external usenet poster
 
Posts: 13
Default How do I load a file from URL


Uzytkownik "Peter" napisal w wiadomosci
oups.com...
Very simple question ...

what methods are there to load a file from a URL and then store it in a
filesystem file?

I'm doing this from VBA excel, but dont actually want (need) the
information inside of excel - but that is where I need to initiate the
transfer.

A quick pointer to an approrpiate library/class would be appreciated.


You can use API's for it. In short like below:

Public 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

Sub GetURLFile(URL As String, Filename As String)
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, Filename, 0, 0)
If lngRetVal < 0 Then
MsgBox "Problem with download " & URL & " file name " & Filename
End If
End Sub

'E.G.using:
Sub Test()
GetURLFile http://www.yourserver.com/fileTOdownload.jpg, "c:\downloaded.jpg"
End Sub


Regards
Mario


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How do I load a file from URL

Hi Mario,

many thanks this is exactly what I wanted .. and already packaged into
a standrd .dll.

As a matter of interest, if there some way I could have discovered this
existence of this function easily - without having to ask the worldwide
community of developers?

Many thanks anyway.

Peter

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
How to load .xla file automatically? Eric Excel Discussion (Misc queries) 1 November 17th 08 01:04 PM
File did not load completely Jackie Lamorie New Users to Excel 1 April 16th 05 12:29 PM
File will not load Jack Sheet Excel Discussion (Misc queries) 3 December 4th 04 01:41 PM
Is it possible to load an .xls file Jako[_55_] Excel Programming 2 August 2nd 04 11:29 PM
How to load a help file using VBA Ian[_9_] Excel Programming 2 January 30th 04 02:19 PM


All times are GMT +1. The time now is 03:33 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"