Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a script written that successfully copy's a file to a directory
based on varibles. I now need lines of code that move files. I copied the lines of code to and changed the varibales to match and nothing is moved. If i change the wording back to FSO.CopyFile, it works, but not FSO.MoveFile... any ideas??? If I put in breaks, and hover over the variables, they all have the correct values: code: __________________________________________________ ________________________ Me.txtArchFile = [Forms]![frmGuides]![sfrmFileName]![HypLink] StrFileNameToArch = Me.txtArchFile If IsNull(StrFileNameToArch) Or StrFileNameToArch = "" Then Exit Sub Else FSO.MoveFile Source:=strCurrentLoc & StrFileNameToArch, _ Destination:=strArchLoc & StrFileNameToArch, _ overwritefiles:=True End If Thanks, Dave On Error GoTo 0 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way to keep the same file name? I have a link stored in an
access database that stores the file name and would like it to be the same. Does it matter that I use "\\server\" in my path server being an IP address? Die_Another_Day wrote: The trick is to ReName the File using the "Name" Command. Name "C:\Test.Txt" As "C:\Folder\Test2.Txt" Charles Chickering wrote: I have a script written that successfully copy's a file to a directory based on varibles. I now need lines of code that move files. I copied the lines of code to and changed the varibales to match and nothing is moved. If i change the wording back to FSO.CopyFile, it works, but not FSO.MoveFile... any ideas??? If I put in breaks, and hover over the variables, they all have the correct values: code: __________________________________________________ ________________________ Me.txtArchFile = [Forms]![frmGuides]![sfrmFileName]![HypLink] StrFileNameToArch = Me.txtArchFile If IsNull(StrFileNameToArch) Or StrFileNameToArch = "" Then Exit Sub Else FSO.MoveFile Source:=strCurrentLoc & StrFileNameToArch, _ Destination:=strArchLoc & StrFileNameToArch, _ overwritefiles:=True End If Thanks, Dave On Error GoTo 0 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Name "C:\Test.txt" as "\\192.168.0.1\Data\Test.txt"
Should work Charles wrote: Is there a way to keep the same file name? I have a link stored in an access database that stores the file name and would like it to be the same. Does it matter that I use "\\server\" in my path server being an IP address? Die_Another_Day wrote: The trick is to ReName the File using the "Name" Command. Name "C:\Test.Txt" As "C:\Folder\Test2.Txt" Charles Chickering wrote: I have a script written that successfully copy's a file to a directory based on varibles. I now need lines of code that move files. I copied the lines of code to and changed the varibales to match and nothing is moved. If i change the wording back to FSO.CopyFile, it works, but not FSO.MoveFile... any ideas??? If I put in breaks, and hover over the variables, they all have the correct values: code: __________________________________________________ ________________________ Me.txtArchFile = [Forms]![frmGuides]![sfrmFileName]![HypLink] StrFileNameToArch = Me.txtArchFile If IsNull(StrFileNameToArch) Or StrFileNameToArch = "" Then Exit Sub Else FSO.MoveFile Source:=strCurrentLoc & StrFileNameToArch, _ Destination:=strArchLoc & StrFileNameToArch, _ overwritefiles:=True End If Thanks, Dave On Error GoTo 0 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I open an Excel file on XP system, saved on a Vista system | Excel Discussion (Misc queries) | |||
File System Object | Excel Programming | |||
How do I close a file system object? | Excel Programming | |||
NTFS file system | Excel Programming | |||
File System Object | Excel Programming |