View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Trevor Shuttleworth Trevor Shuttleworth is offline
external usenet poster
 
Posts: 1,089
Default Copy a folder by macro

I think Dave has answered the question about the code.

With regard to the permissions, I suggest you try to copy the files/folders
manually and see what messages, if any, you get. Certainly, if you've got
Outlook open, I'd expect you to have problems copying files that it is using
or has recently accessed.

Regards

Trevor


"Brettjg" wrote in message
...
Hi Trevor

This is the exact code that I put in, but it gives a compile error of
"User-defined type not defined"


Sub BACKUP_Achiever_logo()
Dim fso As Scripting.FileSystemObject
Set fso = New Scripting.FileSystemObject
fso.CopyFolder "C:\2006-aaalogo\", "C:\99. BACKUPS\2006-aaalogo\"
End Sub

Thanks, Brett

Also I note that when I try to copy some of the files it says
permission
denied. The files are as follows:

SourceFile = "blah blah\Application
Data\Microsoft\Excel\XLSTART\PERSONAL.xls"
SourceFile = "blah blah\My Documents\New Settings File.OPS"
SourceFile = "blah blah\Application
Data\Microsoft\Outlook\Outlook.NK2"
SourceFolder = "blah blah\bgregory.DFS.000\Cookies\"
SourceFolder = "blah blah\Favorites\"
SourceFolder = "blah blah\Start Menu\"

I didn't run the code from PERSONAL.XLS

Thanks in advance. Brett