Hello I am working on an ActiveX Control Object that has a temp data folder that it works from when it is being used, currently on the machine. So far when the Control is executed then it just creates the folder, then when it stops being used then it should be able to delete the folder, that is is using. Then when you execute the Control, again it just renews the folder's time, date and contents of it. That isn't what I am looking to do here...
PS: Here is the Source Code that I am using. Also then this is only the relevant parts to it. I guess that this is able to make the Control to delete the Folder, as per when the Control is removed from execution...
PS: Here is the Source Code that I am using. Also then this is only the relevant parts to it. I guess that this is able to make the Control to delete the Folder, as per when the Control is removed from execution...
Code:
Private Sub UserControl_Terminate()
On Error Resume Next
Dim fsObject As FileSystemObject
Set fsObject = New FileSystemObject
If Dir("c:\temp\project1") = "" Then
fsObject.DeleteFolder ("c:\temp\project1")
End If
End Sub