Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
File copy
Hi,
I would like to be able to put a button in a workbook to copy a file from a web address to a location on my hard drive, but neither FileCopy/CopyFile (API version)/ScriptingObject seem to be able to do it. I would like to do this: CopyFile "http://a.b.c/test.xls","c:\test.xls" Is it possible?? Cheers |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
File copy
try using the workbook.open event and then saving the file to your desired
location. -- Don Guillett SalesAid Software "SkylineGTR" wrote in message oups.com... Hi, I would like to be able to put a button in a workbook to copy a file from a web address to a location on my hard drive, but neither FileCopy/CopyFile (API version)/ScriptingObject seem to be able to do it. I would like to do this: CopyFile "http://a.b.c/test.xls","c:\test.xls" Is it possible?? Cheers |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
File copy
Thanks for the reply Don.
I have tried doing something similar, but I need to do a straight copy, without opening the workbook/s. I am stuck now. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
File copy
Hi Don,
Found out how to do it and wanted to share with the group .. Put the following in a module: 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 then create a wrapper: Public Function DownloadFile(ByVal sURL As String, ByVal sLocalFile As String) As Boolean Dim lngRetVal As Long DownloadFile = URLDownloadToFile(0&, sURL, sLocalFile, 0&, _ 0&) = 0 End Function then you can do: DownloadFile("http://www.a.b.c/afile.zip","c:\afile.zip") |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copy data for match word from one file to another file | Excel Worksheet Functions | |||
How do I copy a excel file into a InDesign file correctly? | Excel Discussion (Misc queries) | |||
copy the same raws of all sheets from about a 100 file to a new sheet of a book and save the file | Setting up and Configuration of Excel | |||
EXCEL FILE a copy/a copy/a copy ....filename | New Users to Excel | |||
VBA Macro to copy an column from one Excel file into another file | Excel Programming |