Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
does anyone have the code needed to move a file to another folder, or a way
of doing this through save as and then delete. The folder will be picked via a variable. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello
Please amend to your needs: Dim fso Set fso = CreateObject("Scripting.FileSystemObject") On Error Resume Next fso.MoveFile "C:\test.xls", "C:\Temp\Test.xls" If Err < 0 Then MsgBox "No such file exists", vbExclamation, "not found" Set fso = Nothing HTH Cordially Pascal "Chris" a écrit dans le message de news: ... does anyone have the code needed to move a file to another folder, or a way of doing this through save as and then delete. The folder will be picked via a variable. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have a look at the VB Name statement in Help.
"The Name statement renames a file and moves it to a different directory or folder, if necessary. " -- Jim "Chris" wrote in message ... | does anyone have the code needed to move a file to another folder, or a way | of doing this through save as and then delete. The folder will be picked via | a variable. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Would you believe it's this easy
Sub movefile() OldName = "C:\oldfolder\filename.xls" NewName = "C:\newfolder\filename.xls" Name OldName As NewName End Sub -- Don Guillett SalesAid Software "Chris" wrote in message ... does anyone have the code needed to move a file to another folder, or a way of doing this through save as and then delete. The folder will be picked via a variable. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need code to save file to new folder, erase from old folder | Excel Discussion (Misc queries) | |||
Buttons Fail After Moving File to Different Folder | Excel Programming | |||
Moving a file from one folder to another | Excel Programming | |||
Moving a folder | Excel Programming | |||
Create Folder and Text File in folder | Excel Programming |