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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, I try to duplicate a folder

Status
Not open for further replies.

loulouly

IS-IT--Management
Jul 17, 2003
6
US
Hi,

I try to duplicate a folder in VBA with this but it doesn't work!
=============================
Private Sub Command1_Click()
Dim fso
Dim fld
SourcePath = "C:\My Documents\My Webs\*"
TargetPath = "C:\My Documents\My Webs\images\"
Set fso = CreateObject("Scripting.FileSystemObject")

fso.CopyFolder SourcePath, TargetPath
End Sub
==============================

I get a "run-time error '5': Invalide procedure call or argument"

What's that?! Don't know what I do wrong, cause it's should work like that! it works with the Copyfile!

Someone has an idea to solve my problem?
Thanx
/Lou
 
Dim fso
Dim fld

Set fso = CreateObject("Scripting.FileSystemObject")
Set fld = fso.CopyFolder SourcePath, TargetPath



DougP, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top