Hi,
The following vba works fine, however if a file is locked and is read only, the code stops.
Is there a line I can enter so it ignores the error? Better still, inform which file is read-only?
The following vba works fine, however if a file is locked and is read only, the code stops.
Is there a line I can enter so it ignores the error? Better still, inform which file is read-only?
Code:
sub copyfile()
Kill "\\retail\dfsroot$\31705 - Business Change\3. Business Readiness & Transitioning\Change Impacts\BIM Docs\Database use only\02-01 Logistics-July2017.xlsm"
On Error GoTo 0
FileCopy Source:="\\retail\dfsroot$\31705 - Business Change\3. Business Readiness & Transitioning\Change Impacts\BIM Docs\02-01 Logistics\02-01 Logistics.xlsm", Destination:="\\retail\dfsroot$\31705 - Business Change\3. Business Readiness & Transitioning\Change Impacts\BIM Docs\Database use only\02-01 Logistics-July2017.xlsm"
'logistics
Kill "\\retail\dfsroot$\31705 - Business Change\3. Business Readiness & Transitioning\Change Impacts\BIM Docs\Database use only\03-01 Fulfilment-July2017.xlsm"
On Error GoTo 0
FileCopy Source:="\\retail\dfsroot$\31705 - Business Change\3. Business Readiness & Transitioning\Change Impacts\BIM Docs\03-01 Fulfilment\03-01 Fulfilment.xlsm", Destination:="\\retail\31705 - Business Change\3. Business Readiness & Transitioning\Change Impacts\BIM Docs\Database use only\03-01 Fulfilment-July2017.xlsm"
'fulfilment
End sub