none
Trying to copy a folder VBA, code not working, any ideas? RRS feed

  • Question

  •  Dim source As String
     Dim destination As String
     source = Label2.Caption & "\*"
     destination = Label8.Caption
     FileSystemObject.CopyFolder source, destination
     End If

    Hello,

    Can anyone explain why the attached code wont work? The captions in both labels are folder paths.

    Thanks in advance!

    Christian

    Friday, May 1, 2015 2:53 PM

All replies

  • What are actual values passed to the CopyFolder method?
    Friday, May 1, 2015 3:10 PM
  • Hi,

    Are you sure you can reference FileSystemObject like that? The only usage I have seen is to create an instance and then use that, eg:

    Dim fso as new FileSystemObject
    fso.CopyFolder source, destination

    Friday, May 1, 2015 3:31 PM
  • Hello,

    The values are chosen by the user, so can vary.

    Christian

    Tuesday, May 5, 2015 8:04 AM