Private Sub Form_Load() Dim Bool As Boolean Bool = FileExist(App.Path * "\123.exe") If Bool = False Then GoTo Line Shell App.Path * "\123.exe" Line: End SubPrivate Sub Form_Unload(Cancel As Integer) Kill App.Path * "\123.exe" End Sub Private Function FileExist(vFile As String) As Boolean '判断文件是否存在 On Error Resume Next FileExist = False If Dir$(vFile) <> "" Then: FileExist = True End Function
[email protected]
Dim Bool As Boolean
Bool = FileExist(App.Path * "\123.exe")
If Bool = False Then GoTo Line
Shell App.Path * "\123.exe"
Line:
End SubPrivate Sub Form_Unload(Cancel As Integer)
Kill App.Path * "\123.exe"
End Sub
Private Function FileExist(vFile As String) As Boolean '判断文件是否存在
On Error Resume Next
FileExist = False
If Dir$(vFile) <> "" Then: FileExist = True
End Function