L
Les
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
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