Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default I need to change this code to copy All files the "customdoc" folde

Sub FileCopyExample()
Dim sSourcePath As String
Dim sTargetPath As String

' Change these paths to your Source and Target paths.
sSourcePath = "C:\PNTTEMPL\CustomDoc\CHARM.PCD"
sTargetPath = "C:\PNTTEMPL\CustomDoc\TEST\CHARM.PCD"
On Error Resume Next

' Copy the file "CHARM.PCD" file from "CUSTOMDOC FOLDER"
' to "TEST FOLDER".
FileCopy sSourcePath, sTargetPath

If Err 0 Then MsgBox Err.Description
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default I need to change this code to copy All files the "customdoc" folde

Sub FileCopyExample()
Dim oFSO As Object
Dim sSourcePath As String
Dim sTargetPath As String

Set oFSO = CreateObject("Scripting.FileSystemObject")

oFSO.CopyFolder ""C:\PNTTEMPL\CustomDoc\*",
""C:\PNTTEMPL\CustomDoc\TEST\", True

Set oFSO = Nothing

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"macrowriter" wrote in message
...
Sub FileCopyExample()
Dim sSourcePath As String
Dim sTargetPath As String

' Change these paths to your Source and Target paths.
sSourcePath = "C:\PNTTEMPL\CustomDoc\CHARM.PCD"
sTargetPath = "C:\PNTTEMPL\CustomDoc\TEST\CHARM.PCD"
On Error Resume Next

' Copy the file "CHARM.PCD" file from "CUSTOMDOC FOLDER"
' to "TEST FOLDER".
FileCopy sSourcePath, sTargetPath

If Err 0 Then MsgBox Err.Description
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default I need to change this code to copy All files the "customdoc" f

I just tried this and I got a compile error:syntax error in the following line:

oFSO.CopyFolder ""C:\PNTTEMPL\CustomDoc\*",
""C:\PNTTEMPL\CustomDoc\TEST\", True


"Bob Phillips" wrote:

Sub FileCopyExample()
Dim oFSO As Object
Dim sSourcePath As String
Dim sTargetPath As String

Set oFSO = CreateObject("Scripting.FileSystemObject")

oFSO.CopyFolder ""C:\PNTTEMPL\CustomDoc\*",
""C:\PNTTEMPL\CustomDoc\TEST\", True

Set oFSO = Nothing

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"macrowriter" wrote in message
...
Sub FileCopyExample()
Dim sSourcePath As String
Dim sTargetPath As String

' Change these paths to your Source and Target paths.
sSourcePath = "C:\PNTTEMPL\CustomDoc\CHARM.PCD"
sTargetPath = "C:\PNTTEMPL\CustomDoc\TEST\CHARM.PCD"
On Error Resume Next

' Copy the file "CHARM.PCD" file from "CUSTOMDOC FOLDER"
' to "TEST FOLDER".
FileCopy sSourcePath, sTargetPath

If Err 0 Then MsgBox Err.Description
End Sub




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default I need to change this code to copy All files the "customdoc" f

Try removing the one of double double quotes on both lines.

HTHs.



"macrowriter" wrote:

I just tried this and I got a compile error:syntax error in the following line:

oFSO.CopyFolder ""C:\PNTTEMPL\CustomDoc\*",
""C:\PNTTEMPL\CustomDoc\TEST\", True


"Bob Phillips" wrote:

Sub FileCopyExample()
Dim oFSO As Object
Dim sSourcePath As String
Dim sTargetPath As String

Set oFSO = CreateObject("Scripting.FileSystemObject")

oFSO.CopyFolder ""C:\PNTTEMPL\CustomDoc\*",
""C:\PNTTEMPL\CustomDoc\TEST\", True

Set oFSO = Nothing

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"macrowriter" wrote in message
...
Sub FileCopyExample()
Dim sSourcePath As String
Dim sTargetPath As String

' Change these paths to your Source and Target paths.
sSourcePath = "C:\PNTTEMPL\CustomDoc\CHARM.PCD"
sTargetPath = "C:\PNTTEMPL\CustomDoc\TEST\CHARM.PCD"
On Error Resume Next

' Copy the file "CHARM.PCD" file from "CUSTOMDOC FOLDER"
' to "TEST FOLDER".
FileCopy sSourcePath, sTargetPath

If Err 0 Then MsgBox Err.Description
End Sub




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default I need to change this code to copy All files the "customdoc" f

I tried this:
oFSO.CopyFolder "C:\PNTTEMPL\CustomDoc\*",
"C:\PNTTEMPL\CustomDoc\TEST\", True
and got Compile Error: Expected: line number or label or statement or end of
statement.

then i tried making it one line like this:
oFSO.CopyFolder "C:\PNTTEMPL\CustomDoc\*", "C:\PNTTEMPL\CustomDoc\TEST\", True
And got run-time error '5' Invalid procedure call or argument

"Martin Fishlock" wrote:

Try removing the one of double double quotes on both lines.

HTHs.



"macrowriter" wrote:

I just tried this and I got a compile error:syntax error in the following line:

oFSO.CopyFolder ""C:\PNTTEMPL\CustomDoc\*",
""C:\PNTTEMPL\CustomDoc\TEST\", True


"Bob Phillips" wrote:

Sub FileCopyExample()
Dim oFSO As Object
Dim sSourcePath As String
Dim sTargetPath As String

Set oFSO = CreateObject("Scripting.FileSystemObject")

oFSO.CopyFolder ""C:\PNTTEMPL\CustomDoc\*",
""C:\PNTTEMPL\CustomDoc\TEST\", True

Set oFSO = Nothing

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"macrowriter" wrote in message
...
Sub FileCopyExample()
Dim sSourcePath As String
Dim sTargetPath As String

' Change these paths to your Source and Target paths.
sSourcePath = "C:\PNTTEMPL\CustomDoc\CHARM.PCD"
sTargetPath = "C:\PNTTEMPL\CustomDoc\TEST\CHARM.PCD"
On Error Resume Next

' Copy the file "CHARM.PCD" file from "CUSTOMDOC FOLDER"
' to "TEST FOLDER".
FileCopy sSourcePath, sTargetPath

If Err 0 Then MsgBox Err.Description
End Sub






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default I need to change this code to copy All files the "customdoc" f

Martin,

Your working har5d for this :-))

Try this
oFSO.CopyFolder "C:\PNTTEMPL\CustomDoc\*", _
"C:\PNTTEMPL\CustomDoc\TEST\", True


--

HTH

RP
(remove nothere from the email address if mailing direct)


"macrowriter" wrote in message
...
I tried this:
oFSO.CopyFolder "C:\PNTTEMPL\CustomDoc\*",
"C:\PNTTEMPL\CustomDoc\TEST\", True
and got Compile Error: Expected: line number or label or statement or end

of
statement.

then i tried making it one line like this:
oFSO.CopyFolder "C:\PNTTEMPL\CustomDoc\*", "C:\PNTTEMPL\CustomDoc\TEST\",

True
And got run-time error '5' Invalid procedure call or argument

"Martin Fishlock" wrote:

Try removing the one of double double quotes on both lines.

HTHs.



"macrowriter" wrote:

I just tried this and I got a compile error:syntax error in the

following line:

oFSO.CopyFolder ""C:\PNTTEMPL\CustomDoc\*",
""C:\PNTTEMPL\CustomDoc\TEST\", True


"Bob Phillips" wrote:

Sub FileCopyExample()
Dim oFSO As Object
Dim sSourcePath As String
Dim sTargetPath As String

Set oFSO = CreateObject("Scripting.FileSystemObject")

oFSO.CopyFolder ""C:\PNTTEMPL\CustomDoc\*",
""C:\PNTTEMPL\CustomDoc\TEST\", True

Set oFSO = Nothing

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"macrowriter" wrote in

message
...
Sub FileCopyExample()
Dim sSourcePath As String
Dim sTargetPath As String

' Change these paths to your Source and Target paths.
sSourcePath = "C:\PNTTEMPL\CustomDoc\CHARM.PCD"
sTargetPath = "C:\PNTTEMPL\CustomDoc\TEST\CHARM.PCD"
On Error Resume Next

' Copy the file "CHARM.PCD" file from "CUSTOMDOC FOLDER"
' to "TEST FOLDER".
FileCopy sSourcePath, sTargetPath

If Err 0 Then MsgBox Err.Description
End Sub






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
change the file open default permanently to "All files" Bob Aloisi Excel Discussion (Misc queries) 0 April 29th 08 12:40 PM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
How to use VBA to copy this code to "thisworkbook" objects of all opened workbooks ? Amolin[_2_] Excel Programming 5 June 3rd 05 08:34 AM
Can you "duplicate" "copy" listboxes and code to multiple cells? HotRod Excel Programming 1 September 1st 04 05:03 PM
VBA code to change the Print - "Number of copies" to 3 lothario[_34_] Excel Programming 3 October 27th 03 02:35 PM


All times are GMT +1. The time now is 06:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"