LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Les Les is offline
external usenet poster
 
Posts: 240
Default Move File to new folder - Problem

Good day all, i am using the method below to move a file on the network but
it is not working, as i am not a programmer maybe i am missing something ??
Could anybody help please ??

Sub ChDirNet(szPath As String)
Dim lReturn As Long
lReturn = SetCurrentDirectoryA(szPath)
If lReturn = 0 Then Err.Raise vbObjectError + 1, "Error setting
path-Drive not mapped."
End Sub

Sub MoveOrigFileToArchive()
'
Dim OldName As String, newname As String, Todaysdate As String
Dim Cancel As Variant

Todaysdate = Format(Date, "dd.mm.yy")
'-------- Set the path
---------------------------------------------------------------------------
' ChDirNet "\\zapad01\sapinter\LCS\" '---- must change here for SAP path
-------
On Error Resume Next
OldName = "\\zapad01\sapinter\LCS\" & myLCS & ".xls"
newname = "\\zapad01\sapinter\LCS\Archive\" & Todaysdate & "_" & myLCS &
".xls"
Name OldName As newname
ChDir mySavedPath
MoveLCSFileToArchive
End Sub

--
Les
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA to move an excel file to another folder tvt Excel Discussion (Misc queries) 3 December 19th 13 02:53 PM
Any problem if i move a shared folder from my desktop to d drive shanavas Excel Discussion (Misc queries) 1 December 16th 07 03:22 PM
Save file in a new folder, but create folder only if folder doesn't already exist? nbaj2k[_40_] Excel Programming 6 August 11th 06 08:41 PM
Move file to a different folder ebferro Excel Programming 0 October 31st 04 10:05 AM
Move file to different folder Don Guillett[_4_] Excel Programming 4 August 29th 03 07:35 PM


All times are GMT +1. The time now is 12:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"