Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to move a folder from "quotes" to "sales" and
cannot get it right. What is wrong? Sub Move() Dim sFolder As Scripting.folder Dim sDestination As String Set sFolder = "\\quotes\" & ActiveSheet.Range("S7") & "\" & ActiveSheet.Range("h14") sDestination = "\\Sales\" & ActiveSheet.Range("S7") & "\" & ActiveSheet.Range("h14") MoveFolder sFolder, sDestination End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you mean move a file from one folder to another you can modify this.
Sub movefile() OldName = "C:\sourcefoldername\1065.xls" NewName = "C:\destinationfoldername\1065.xls" Name OldName As NewName End Sub -- Don Guillett SalesAid Software "Gary" wrote in message ... I am trying to move a folder from "quotes" to "sales" and cannot get it right. What is wrong? Sub Move() Dim sFolder As Scripting.folder Dim sDestination As String Set sFolder = "\\quotes\" & ActiveSheet.Range("S7") & "\" & ActiveSheet.Range("h14") sDestination = "\\Sales\" & ActiveSheet.Range("S7") & "\" & ActiveSheet.Range("h14") MoveFolder sFolder, sDestination End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This worked for me:
Sub MoveAFolder(Drivespec) Dim fso Set fso = CreateObject("Scripting.FileSystemObject") fso.MoveFolder Drivespec, "\\logfs03\Users\Ogilvtw\TT2\" End Sub Sub CallMove() Drivespec = "\\logfs04\Dpl-div\TT1" MoveAFolder Drivespec End Sub -- Regards, Tom Ogilvy "Gary" wrote in message ... I am trying to move a folder from "quotes" to "sales" and cannot get it right. What is wrong? Sub Move() Dim sFolder As Scripting.folder Dim sDestination As String Set sFolder = "\\quotes\" & ActiveSheet.Range("S7") & "\" & ActiveSheet.Range("h14") sDestination = "\\Sales\" & ActiveSheet.Range("S7") & "\" & ActiveSheet.Range("h14") MoveFolder sFolder, sDestination End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When I tried it, it brought up a list of macros to select
and run. Any idea why or how to fix? -----Original Message----- This worked for me: Sub MoveAFolder(Drivespec) Dim fso Set fso = CreateObject("Scripting.FileSystemObject") fso.MoveFolder Drivespec, "\\logfs03\Users\Ogilvtw\TT2 \" End Sub Sub CallMove() Drivespec = "\\logfs04\Dpl-div\TT1" MoveAFolder Drivespec End Sub -- Regards, Tom Ogilvy "Gary" wrote in message ... I am trying to move a folder from "quotes" to "sales" and cannot get it right. What is wrong? Sub Move() Dim sFolder As Scripting.folder Dim sDestination As String Set sFolder = "\\quotes\" & ActiveSheet.Range("S7") & "\" & ActiveSheet.Range("h14") sDestination = "\\Sales\" & ActiveSheet.Range("S7") & "\" & ActiveSheet.Range("h14") MoveFolder sFolder, sDestination End Sub . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You have to run CallMove, not MoveAfolder.
However, I offered it as a sample of how you might fix your own macro. -- Regards, Tom Ogilvy "Gary" wrote in message ... When I tried it, it brought up a list of macros to select and run. Any idea why or how to fix? -----Original Message----- This worked for me: Sub MoveAFolder(Drivespec) Dim fso Set fso = CreateObject("Scripting.FileSystemObject") fso.MoveFolder Drivespec, "\\logfs03\Users\Ogilvtw\TT2 \" End Sub Sub CallMove() Drivespec = "\\logfs04\Dpl-div\TT1" MoveAFolder Drivespec End Sub -- Regards, Tom Ogilvy "Gary" wrote in message ... I am trying to move a folder from "quotes" to "sales" and cannot get it right. What is wrong? Sub Move() Dim sFolder As Scripting.folder Dim sDestination As String Set sFolder = "\\quotes\" & ActiveSheet.Range("S7") & "\" & ActiveSheet.Range("h14") sDestination = "\\Sales\" & ActiveSheet.Range("S7") & "\" & ActiveSheet.Range("h14") MoveFolder sFolder, sDestination End Sub . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Moving text around cells without moving boarder lines | Excel Discussion (Misc queries) | |||
Arrow Keys Moving Window Frame instead of Moving Between Cells | Excel Discussion (Misc queries) | |||
Offline folders | Excel Discussion (Misc queries) | |||
Personalize folders | Excel Discussion (Misc queries) | |||
Moving workbooks between folders | Excel Discussion (Misc queries) |