Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a macro to copy files to local hard drive

Status
Not open for further replies.

chippyles

Technical User
Nov 10, 2004
49
US
How can I set up a macro to copy files from a network drive to a local folder on their hard drive? I would like to do this without seeing the DOS window (cmd).
 
function fcopy (s,d)
FileCopy s, d
end function

macro runcode fcopy source, destination
 
I am getting an erro that says, "expression you entered has a function name that 'Data Collection' can't find."
 
where would i place this function because I can not use it properly.
 
make a module with this function
public Function fcopy()
FileCopy InputBox("enter name of source file"), InputBox("enter destionation of source file")
End Function

create a macro on the action line enter run code
in the function name line enter fcopy

when you run the function it will prompt you for the source file name and the destentinon name
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top