aziz rasul
09-16-2008, 07:17 AM
I have the following VBA code in a module, which deletes a file: -
Public Sub KillFile(strFilepath As String, strFilename As String)
If Dir(strFilepath & strFilename) <> "" Then
Kill (strFilepath & strFilename)
End If
End Sub
I have a file called "L:\Files\Information\Reports\Inpatients\Theatre Session Utilisation and Activity.xls"
The L drive is mapped to the network, which is called
xdeptSH on 'EMC-SNAS:T5.5.32.4 (stg1nas01)' (L: )
I want to delete the Theatre Session Utilisation and Activity.xls file without referring to the L drive as other people will be using the db and they may be mapped to the network using a different letter.
How do I call the KillFile code using the network path?
Public Sub KillFile(strFilepath As String, strFilename As String)
If Dir(strFilepath & strFilename) <> "" Then
Kill (strFilepath & strFilename)
End If
End Sub
I have a file called "L:\Files\Information\Reports\Inpatients\Theatre Session Utilisation and Activity.xls"
The L drive is mapped to the network, which is called
xdeptSH on 'EMC-SNAS:T5.5.32.4 (stg1nas01)' (L: )
I want to delete the Theatre Session Utilisation and Activity.xls file without referring to the L drive as other people will be using the db and they may be mapped to the network using a different letter.
How do I call the KillFile code using the network path?