Hi I am new to VBA and I am looking for some code to use in access 2007 where I can cut the entire contents of a folder on my C: drive and paste it in a separate folder in my C: Drive
Thankyou.
Hi I am new to VBA and I am looking for some code to use in access 2007 where I can cut the entire contents of a folder on my C: drive and paste it in a separate folder in my C: Drive
Thankyou.
If your OS is located on your C drive, you will not be able to "Cut" the entire C drive. You probably will not be able to "Copy" the entire C drive either. Are you trying to Clone?
Maybe this is what you are looking for?
https://www.accessforums.net/program...ugh-39179.html
Thank you for your help at the end I used the following code which done the trick, it actually cops pastes and deletes the file in the source
Code:Dim sourceFile As String, destinationFile As String Dim aFSO As Object sourceFile = "C:\Users\Test1\ToImport" destinationFile = "C:\Users\Test1\imported" Set aFSO = CreateObject("Scripting.FileSystemObject") aFSO.CopyFolder sourceFile, destinationFile Kill "C:\Users\Test1\ToImport\*.URS*"
Glad you have it sorted out and welcome to the forum. In the future, please be sure to tell other users if you are cross posting your question in other forums and provide a link to your other thread. Thank you.
Thanks but I actually got it from a colleague in my organisation through another colleague
Great. Thank you for sharing your solution. This may benefit others that need an answer for their project. Once again, welcome!