I have the following code to copy all the workbooks (.Xlsm files) from one folder "C:\Parts & SVC Sales" to another folder
"C:\My Documents"
It would be appreciated if someone could assist in resolving this
When running the macro error message comes up "cannot find project or library" and referes to the code below
"C:\My Documents"
It would be appreciated if someone could assist in resolving this
When running the macro error message comes up "cannot find project or library" and referes to the code below
Code:
If Right(FromPath, 1) = "\" Then
Code:
Dim FromPath As String
Dim ToPath As String
FromPath = "C:\Parts & SVC Sales"
ToPath = "C:\My Documents"
If Right(FromPath, 1) = "\" Then
FromPath = Left(FromPath, Len(FromPath) - 1)
End If
If Right(ToPath, 1) = "\" Then
ToPath = Left(ToPath, Len(ToPath) - 1)
End If
Set FSO = CreateObject("scripting.filesystemobject")
If FSO.FolderExists(FromPath) = False Then
MsgBox FromPath & " doesn't exist"
Exit Sub
End If
FSO.CopyFolder Source:=FromPath, Destination:=ToPath
MsgBox "You can find the files and subfolders from " & FromPath & " in " & ToPath
End Sub