Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try
Sub movefile() OldName = "C:\sourcefoldername\1065.xls" NewName = "C:\destinationfoldername\1065.xls" Name OldName As NewName End Sub "Michael Bond" wrote in message ... Hello all I have created a project to open all files in a folder, perform some work with the data in the file(s), set the file save property as true and close the file. I now want to move the file out of that folder into another. I just cannot get my head round the code I need to do that. Sample of my code attached....can any one provide the '????????? line which is moving the file out of the folder into a different folder. Much obliged for your attention Regards Michael Bond Sub WorkOnFile() Dim fs, f, f1, fc, s Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFolder("X:\******** *******\") Set fc = f.Files For Each f1 In fc '(Various code here which opens file and carries out some work then...) ActiveWorkbook.Saved = True ActiveWorkbook.Close '???????????????? Next |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA to move an excel file to another folder | Excel Discussion (Misc queries) | |||
Move Active Workbook to another Folder | Excel Discussion (Misc queries) | |||
Any problem if i move a shared folder from my desktop to d drive | Excel Discussion (Misc queries) | |||
move a sheet out of my workbook and place in another folder? | Excel Discussion (Misc queries) | |||
Need code to save file to new folder, erase from old folder | Excel Discussion (Misc queries) |