Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy A File From Internet To My Desktop
What are the codes to copy a text file from the internet location
"http://www.myweb.com/myfolder/TheTextFile.txt" to my local C drive as "C:\TheTextFile.txt"? I tried FileCopy but to no avail. Thanks in advance. -- Edmund (Using Excel 2000) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy A File From Internet To My Desktop
Set fsmove = CreateObject("Scripting.FileSystemObject")
FName = "http://www.myweb.com/myfolder/TheTextFile.txt" Set MyFile = fsmove.getfile(FName) SName = MyFile.shortname fsmove.CopyFile FName, "c:\" & SName "Edmund" wrote: What are the codes to copy a text file from the internet location "http://www.myweb.com/myfolder/TheTextFile.txt" to my local C drive as "C:\TheTextFile.txt"? I tried FileCopy but to no avail. Thanks in advance. -- Edmund (Using Excel 2000) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy A File From Internet To My Desktop
Thanks for helping but I got "Run-time error '53': File not found" at line
"Set MyFile = fsmove.getfile(FName)" I tested with: FName = "http://www.cpearson.com/Zips/modActivateExcel.zip" What's wrong? -- Edmund (Using Excel 2003 & 2000) |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy A File From Internet To My Desktop
Hi Edmund,
I think it might be that a .zip file is not a .txt file. Dan |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy A File From Internet To My Desktop
Hi Edmund, try this
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 llRetVal As Long Sub Download() llRetVal = URLDownloadToFile(0, "http://www.cpearson.com/Zips/ modActivateExcel.zip", "c:\modActivateExcel.zip", 0, 0) End Sub ______________________ Nuno Rocha |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy A File From Internet To My Desktop
I can't get Chip's file to download. chip may have access priviledges on his
file that doesn't allow copying the file. But try your code again except remove the "http:" from the file name . I forgot when you access a file from the web excel doesn't like the http from FName = "http://www.myweb.com/myfolder/TheTextFile.txt" to FName = "//www.myweb.com/myfolder/TheTextFile.txt" "Edmund" wrote: Thanks for helping but I got "Run-time error '53': File not found" at line "Set MyFile = fsmove.getfile(FName)" I tested with: FName = "http://www.cpearson.com/Zips/modActivateExcel.zip" What's wrong? -- Edmund (Using Excel 2003 & 2000) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy cell from Excel file and paste into control on internet page | Excel Programming | |||
How to copy a file from internet to local drive on VBA | Excel Programming | |||
It saves a copy on my desktop with a different file name? | Setting up and Configuration of Excel | |||
Desktop shortcut to a named Excel file - every time I open it adds a "1" to the file name - how to disable? | Setting up and Configuration of Excel | |||
Download (copy) file from the internet | Excel Programming |