Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA to move an excel file 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) | |||
Save file in a new folder, but create folder only if folder doesn't already exist? | Excel Programming | |||
Move file to a different folder | Excel Programming | |||
Move file to different folder | Excel Programming |